Parsely/wp-parsely

Add Additional Supported Post Schema @types

Closed this issue · 1 comments

Describe the bug

Parse.ly currently supports 17 @types for post content in the JSON-LD output:
https://docs.parse.ly/metadata-jsonld/#h-type-values-that-parse-ly-recognizes-as-posts

However, the WordPress plugin only supports 8.
https://github.com/Parsely/wp-parsely/blob/develop/src/class-parsely.php#L93-L110

The missing @types are:

The plugin will return index if the type is not one of the 8 supported content types:
https://github.com/Parsely/wp-parsely/blob/develop/src/class-parsely.php#L508-L524

This can be replicated by using the following filter:

function podcast_wp_parsely_metadata( $parsely_page, $post, $options ) {
    
   $parsely_page['@type']  = 'PodcastEpisode';
    return $parsely_page;
}
add_filter( 'wp_parsely_metadata', 'podcast_wp_parsely_metadata', 10, 3 );

Expected behavior

All @types supported by Parse.ly are support by the WordPress plugin.

@BrookeDot, a fix has been created and merged. It will become available in our next release. Thanks for reporting this!