Skip to content

Commit

Permalink
Cleanup: Remove breadcrumbs configuration
Browse files Browse the repository at this point in the history
The breadcrumbs were removed from subpages before #269 was merged, but this configuration code was left in place. It's not used, and can be removed
  • Loading branch information
ryelle committed Apr 30, 2024
1 parent 618fd76 commit f4865a1
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions source/wp-content/themes/wporg-main-2022/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
add_action( 'init', __NAMESPACE__ . '\register_shortcodes' );
add_filter( 'wp_img_tag_add_loading_attr', __NAMESPACE__ . '\override_lazy_loading', 10, 2 );
add_filter( 'wporg_block_site_breadcrumbs', __NAMESPACE__ . '\update_site_breadcrumbs' );
add_filter( 'render_block_core/site-title', __NAMESPACE__ . '\use_parent_page_title', 10, 3 );
add_filter( 'render_block_data', __NAMESPACE__ . '\update_header_template_part_class' );
add_filter( 'wporg_block_navigation_menus', __NAMESPACE__ . '\add_site_navigation_menus' );
Expand Down Expand Up @@ -134,32 +133,6 @@ function override_lazy_loading( $value, $image ) {
return $value;
}

/**
* Use the page heirarchy to display breadcrumbs.
*/
function update_site_breadcrumbs( $breadcrumbs ) {
$parent = get_post_parent();
if ( ! $parent ) {
return $breadcrumbs;
}

$breadcrumbs = array();
$breadcrumbs[] = array(
'url' => false,
'title' => get_the_title(),
);

while ( $parent ) {
$breadcrumbs[] = array(
'url' => get_permalink( $parent->ID ),
'title' => $parent->post_title,
);
$parent = get_post_parent( $parent );
}

return array_reverse( $breadcrumbs );
}

/**
* Provide a list of local navigation menus.
*/
Expand Down

0 comments on commit f4865a1

Please sign in to comment.