WordLift中的自定义帖子类型支持 [英] Custom post types support in WordLift
问题描述
我正在使用适用于WordPress的WordLift插件,我想在我的网站上为其他自定义帖子类型添加对语义SEO的支持.有办法吗?
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?
推荐答案
是的,有一个过滤器可用于添加自定义帖子类型:wl_valid_entity_post_types
.
Yes, there's a filter you can use to add the custom post types: wl_valid_entity_post_types
.
过滤器采用具有受支持的帖子类型(默认为post
,page
和entity
)的数组.您可以将自定义帖子类型添加到数组中并返回它,例如:
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;
});
add_filter('wl_valid_entity_post_types', function ($post_types) {
$post_types[] = 'gallery';
return $post_types;
});
作为参考添加WordPress过滤器以允许客户扩展可以在GitHub上变成了实体.
这篇关于WordLift中的自定义帖子类型支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!