tag and aria-current if !== ''. * @param string $link Url of page. * @param string $txt Text to render in span tag (ie the name of the crumb). */ function marie_wrap_in_li_span( $active = '', $link = '', $txt ) { global $marie_crumb_count; $marie_crumb_count++; $aria = ''; // If $active is set, add 'class="active" as well as 'aria-current="page"' to the
  • attributes. if ( '' !== $active ) { $active = ' class="' . esc_attr( $active ) . '"'; $aria = ' aria-current="' . esc_attr( 'page' ) . '"'; } $open_li_span = '
  • '; $close_li_span = '
  • '; if ( '' !== $link ) { $new_ans = '
  • ' . esc_html( $txt ) . '
  • '; } else { // If $link is NOT set, only the $txt will be wrapped in the
  • . $new_ans = $open_li_span . esc_html( $txt ) . $close_li_span; } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. echo $new_ans; } /** * Echo Breadcrumbs. * * @package marie */ if ( ! function_exists( 'marie_breadcrumbs' ) ) { /** * Echo Breadcrumbs * * A lot of the logic is based on Breadcrumbs in https://github.com/rachelbaker/bootstrapwp-Twitter-Bootstrap-for-WordPress/blob/master/functions.php */ function marie_breadcrumbs() { global $post, $paged; $aria_nav_label = __( 'Breadcrumb', 'marie' ); ob_start(); echo ''; $ans = ob_get_clean(); if ( $ans ) { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above & in marie_wrap_in_li_span. echo $ans; } } }