-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
When you change the default post type archive title, you can see it works when on a post type archive page, but there's no effect on the content displayed by the breadcrump for a single post.
Without changing the post type archive title :
- archive page : Home > Events archive
- single page : Home > Events archive > Term name > Post title
When using the post_type_archive_title hook to rename the post type archive title :
- archive page : Home > Events
- single page : Home > Events archive > Term name > Post title
I have used the following function to rename the post type archive title
function rename_archive_title( string $title ): string {
$post_type = get_query_var( 'post_type' );
$post_type_object = get_post_type_object( $post_type );
return $post_type_object->labels->name ?? $title;
}
add_filter( 'post_type_archive_title', __NAMESPACE__ . '\rename_archive_title', 10 );Step-by-step reproduction instructions
- Change the post type archive title using the
post_type_archive_titlefilter hook - See that it works on the breadcrumb displayed on the archive page
- See that it has no effect on the breadcrumb displayed on the single page
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Metadata
Metadata
Assignees
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended