Bug when overriding wpseo_schema_article_post_types
-
When trying to override the schema for a custom post type (CPT) and tell Yoast (version 11.8) it is an “Article”, you need to add a filter in your functions.php:
function schema_article_post_types($post_types) { $post_types = array('long_form', 'post'); return $post_types; } add_filter( 'wpseo_schema_article_post_types', 'schema_article_post_types');
It works for adding the “Article” type but it fails to add the required “Author”. In the file ./frontend/schema/class-schema-author.php on line 99 the code references a filter that does not exist:
$post_types = apply_filters( 'wpseo_schema_article_post_type', array( 'post' ) );
wpseo_schema_article_post_type should be plural “wpseo_schema_article_post_types“.
$post_types = apply_filters( 'wpseo_schema_article_post_types', array( 'post' ) );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Bug when overriding wpseo_schema_article_post_types’ is closed to new replies.