Prerequisites
Please give us a description of what happened
We have custom post types, which we basically use and want to behave like the default posts. We want to show the author meta tag for those.
This if here
|
if ( $this->presentation->model->object_sub_type !== 'post' ) { |
|
return ''; |
|
} |
blocks all logic and especially the filter execution a few lines below:
|
return \trim( $this->helpers->schema->html->smart_strip_tags( \apply_filters( 'wpseo_meta_author', $user_data->display_name, $this->presentation ) ) ); |
At the moment it is therefore not possible to use the existing code for non-default post types.
Can this be changed or should we use other means?
Step-by-step reproduction instructions
- Add a custom post type
- Create a post
- Add filter
add_filter(
'wpseo_meta_author',
static fn (string $author_name) => 'test',
);
- View the source => No meta author tag
Expected results
- Visible author meta tag
Actual results
- No author meta tag
Screenshots, screen recording, code snippet
No response
Which editor is affected (or editors)
Which browser is affected (or browsers)
Device you are using
No response
Operating system
No response
PHP version
No response
WordPress version
6.9.4
WordPress Theme
No response
Yoast SEO version
27.4
Gutenberg plugin version (if relevant)
No response
Elementor plugin version (if relevant)
No response
Classic Editor plugin version (if relevant)
No response
Relevant plugins in case of a bug
No response
Prerequisites
Please give us a description of what happened
We have custom post types, which we basically use and want to behave like the default posts. We want to show the author meta tag for those.
This
ifherewordpress-seo/src/presenters/meta-author-presenter.php
Lines 41 to 43 in 92b9651
blocks all logic and especially the filter execution a few lines below:
wordpress-seo/src/presenters/meta-author-presenter.php
Line 57 in 92b9651
At the moment it is therefore not possible to use the existing code for non-default post types.
Can this be changed or should we use other means?
Step-by-step reproduction instructions
Expected results
Actual results
Screenshots, screen recording, code snippet
No response
Which editor is affected (or editors)
Which browser is affected (or browsers)
Device you are using
No response
Operating system
No response
PHP version
No response
WordPress version
6.9.4
WordPress Theme
No response
Yoast SEO version
27.4
Gutenberg plugin version (if relevant)
No response
Elementor plugin version (if relevant)
No response
Classic Editor plugin version (if relevant)
No response
Relevant plugins in case of a bug
No response