コード例 #1
0
 /**
  * Setup the post types for forums, topics and replies
  *
  * @since bbPress (r2597)
  * @uses register_post_type() To register the post types
  * @uses apply_filters() Calls various filters to modify the arguments
  *                        sent to register_post_type()
  */
 public static function register_post_types()
 {
     /** Forums ************************************************************/
     // Register Forum content type
     register_post_type(bbp_get_forum_post_type(), apply_filters('bbp_register_forum_post_type', array('labels' => bbp_get_forum_post_type_labels(), 'rewrite' => bbp_get_forum_post_type_rewrite(), 'supports' => bbp_get_forum_post_type_supports(), 'description' => __('bbPress Forums', 'bbpress'), 'capabilities' => bbp_get_forum_caps(), 'capability_type' => array('forum', 'forums'), 'menu_position' => 555555, 'has_archive' => bbp_get_root_slug(), 'exclude_from_search' => true, 'show_in_nav_menus' => true, 'public' => true, 'show_ui' => current_user_can('bbp_forums_admin'), 'can_export' => true, 'hierarchical' => true, 'query_var' => true, 'menu_icon' => '')));
     /** Topics ************************************************************/
     // Register Topic content type
     register_post_type(bbp_get_topic_post_type(), apply_filters('bbp_register_topic_post_type', array('labels' => bbp_get_topic_post_type_labels(), 'rewrite' => bbp_get_topic_post_type_rewrite(), 'supports' => bbp_get_topic_post_type_supports(), 'description' => __('bbPress Topics', 'bbpress'), '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' => '')));
     /** Replies ***********************************************************/
     // Register reply content type
     register_post_type(bbp_get_reply_post_type(), apply_filters('bbp_register_reply_post_type', array('labels' => bbp_get_reply_post_type_labels(), 'rewrite' => bbp_get_reply_post_type_rewrite(), 'supports' => bbp_get_reply_post_type_supports(), 'description' => __('bbPress Replies', 'bbpress'), 'capabilities' => bbp_get_reply_caps(), 'capability_type' => array('reply', 'replies'), 'menu_position' => 555555, 'exclude_from_search' => true, 'has_archive' => false, 'show_in_nav_menus' => false, 'public' => true, 'show_ui' => current_user_can('bbp_replies_admin'), 'can_export' => true, 'hierarchical' => false, 'query_var' => true, 'menu_icon' => '')));
 }
コード例 #2
0
ファイル: setup-bbpress.php プロジェクト: pab44/pab44
 function wm_bbp_shortcode_posts_post_types($post_types)
 {
     //Preparing output
     $forums_labels = bbp_get_forum_post_type_labels();
     $post_types[bbp_get_forum_post_type()] = $forums_labels['name'];
     //Output
     return $post_types;
 }