问题
I am using the WordLift plugin for WordPress and I'd like to add support for Semantic SEO for other custom post types in my web site. Is there a way to do this?
回答1:
Yes, there's a filter you can use to add the custom post types: wl_valid_entity_post_types
.
The filter takes an array with the supported post types (by default post
, page
and entity
). You can add custom post types to the array and return it, e.g.:
add_filter('wl_valid_entity_post_types', function ($post_types) {
$post_types[] = 'gallery';
return $post_types;
});
For reference add a WordPress filter to allow customers to extend the post types that can be turned into entities on GitHub.
来源:https://stackoverflow.com/questions/49011300/custom-post-types-support-in-wordlift