Skip to content

Commit

Permalink
Block Theme: Update site title to "Patterns" in local nav
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Mar 20, 2024
1 parent f1fb6ee commit 2a7f193
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
add_filter( 'render_block_core/search', __NAMESPACE__ . '\inject_category_search_block' );
add_filter( 'wporg_block_navigation_menus', __NAMESPACE__ . '\add_site_navigation_menus' );
add_filter( 'render_block_core/query-title', __NAMESPACE__ . '\update_archive_title', 10, 3 );
add_filter( 'render_block_core/site-title', __NAMESPACE__ . '\update_site_title', 10, 3 );
add_filter( 'wporg_block_site_breadcrumbs', __NAMESPACE__ . '\update_site_breadcrumbs' );
add_filter( 'render_block_data', __NAMESPACE__ . '\modify_pattern_include' );

Expand Down Expand Up @@ -399,6 +400,19 @@ function update_archive_title( $block_content, $block, $instance ) {
return $block_content;
}

/**
* Update the archive title for all filter views.
*
* @param string $block_content The block content.
*/
function update_site_title( $block_content, $block, $instance ) {
return str_replace(
get_bloginfo( 'name' ),
__( 'Patterns', 'wporg-patterns' ),
$block_content
);
}

/**
* Update the breadcrumbs to the current page.
*/
Expand Down

0 comments on commit 2a7f193

Please sign in to comment.