Skip to content

Bug: Breadcrumb returns empty div when no breadcrumbs #111

Description

@alektrefi

While setting up Breadcrumbs for law https://github.com/bu-ist/r3-law/pull/114, it was discovered that the breadcrumbs function returns an empty div(element chosen) when there are no breadcrumbs. It would be preferable to return an empty string instead. If that may break something, a new option to return an empty string could be added.

Sample code from r3-law

						$breadcrumb_args = array(
							'glue'            => ' / ',
							'container_tag'   => 'div',
							'container_id'    => '',
							'container_class' => 'bu-banner-breadcrumbs',
							'anchor_class'    => 'crumb',
							'crumb_current'   => false,
							'anchor_current'  => false,
							'echo'            => true,
							'include_hidden'  => true,
						);

						bu_navigation_breadcrumbs( $breadcrumb_args );
					}

Screen Shot 2022-01-20 at 3 06 01 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions