bbPress: register_post_types ()
设置论坛、主题和回复的文章类型
描述
源
文件:bp-forums /类/ class-bbpress.php
公共静态函数register_post_types(){/ * *论坛 ************************************************************/ // 注册论坛内容类型register_post_type (bbp_get_forum_post_type (), apply_filter (bbp_register_forum_post_type,阵列('标签' = > bbp_get_forum_post_type_labels(),“重写”= > bbp_get_forum_post_type_rewrite (),'支持' = > bbp_get_forum_post_type_supports()的描述 ' => __( ' 论坛”、“buddyboss”),“功能”= > bbp_get_forum_caps(),“capability_type”= >数组(“论坛”、“论坛”)、“menu_position ' = > 555555, has_archive”= > bbp_get_root_slug(),“exclude_from_search ' = > true, show_in_nav_menus”= > true,“公众”= >真的,'show_ui' => current_user_can('bbp_forums_admin'), 'can_export' => true, 'hierarchical' => true, 'query_var' => true, 'menu_icon' => ", 'show_in_menu' => false,));Add_post_type_support (bbp_get_forum_post_type(), '缩略图');/ * *主题 ************************************************************/ // 注册主题内容类型register_post_type (bbp_get_topic_post_type (), apply_filter (bbp_register_topic_post_type,阵列('标签' = > bbp_get_topic_post_type_labels(),“重写”= > bbp_get_topic_post_type_rewrite(),“支持”= > bbp_get_topic_post_type_supports (),'description' => __('Forum Discussions', 'buddyboss'), 'capabilities' => bbp_get_topic_caps(), 'capability_type' => array('topic', 'topics'), 'menu_position' => 555555, 'has_archive' => ('forums' === bbp_show_on_root()) ?Bbp_get_topic_archive_slug (): false, 'exclude_from_search' => true, 'show_in_nav_menus' => false, 'public' => true, 'show_ui' => current_user_can('bbp_topics_admin'), 'can_export' => true, 'hierarchical' => false, 'query_var' => true, 'menu_icon' => ", 'show_in_menu' => false,));/ * *回复 ***********************************************************/ // 注册回复内容类型register_post_type (bbp_get_reply_post_type (), apply_filter (bbp_register_reply_post_type,阵列('标签' = > bbp_get_reply_post_type_labels(),“重写”= > bbp_get_reply_post_type_rewrite(),“支持”= > bbp_get_reply_post_type_supports (),的描述 ' => __( ' 论坛回复”、“buddyboss”),“功能”= > bbp_get_reply_caps(),“capability_type”= >数组(“回复”、“回复”)、“menu_position ' = > 555555, exclude_from_search ' = > true, has_archive ' = > false, show_in_nav_menus ' = > false,公众“= > true,”show_ui”= > current_user_can(“bbp_replies_admin”)、“can_export”= >真的,“分层”= > false, query_var = > true, menu_icon ' => '', ' show_in_menu ' = > false,))); }
更新日志
版本 | 描述 |
---|---|
bbPress (r2597) | 介绍了。 |