/**
  * 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' => '')));
 }
Exemple #2
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()
 {
     // Define local variable(s)
     $post_type = array();
     /** Forums ************************************************************/
     // Forum labels
     $post_type['labels'] = array('name' => __('Forums', 'bbpress'), 'menu_name' => __('Forums', 'bbpress'), 'singular_name' => __('Forum', 'bbpress'), 'all_items' => __('All Forums', 'bbpress'), 'add_new' => __('New Forum', 'bbpress'), 'add_new_item' => __('Create New Forum', 'bbpress'), 'edit' => __('Edit', 'bbpress'), 'edit_item' => __('Edit Forum', 'bbpress'), 'new_item' => __('New Forum', 'bbpress'), 'view' => __('View Forum', 'bbpress'), 'view_item' => __('View Forum', 'bbpress'), 'search_items' => __('Search Forums', 'bbpress'), 'not_found' => __('No forums found', 'bbpress'), 'not_found_in_trash' => __('No forums found in Trash', 'bbpress'), 'parent_item_colon' => __('Parent Forum:', 'bbpress'));
     // Forum rewrite
     $post_type['rewrite'] = array('slug' => bbp_get_forum_slug(), 'with_front' => false);
     // Forum supports
     $post_type['supports'] = array('title', 'editor', 'revisions');
     // Register Forum content type
     register_post_type(bbp_get_forum_post_type(), apply_filters('bbp_register_forum_post_type', array('labels' => $post_type['labels'], 'rewrite' => $post_type['rewrite'], 'supports' => $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 ************************************************************/
     // Topic labels
     $post_type['labels'] = array('name' => __('Topics', 'bbpress'), 'menu_name' => __('Topics', 'bbpress'), 'singular_name' => __('Topic', 'bbpress'), 'all_items' => __('All Topics', 'bbpress'), 'add_new' => __('New Topic', 'bbpress'), 'add_new_item' => __('Create New Topic', 'bbpress'), 'edit' => __('Edit', 'bbpress'), 'edit_item' => __('Edit Topic', 'bbpress'), 'new_item' => __('New Topic', 'bbpress'), 'view' => __('View Topic', 'bbpress'), 'view_item' => __('View Topic', 'bbpress'), 'search_items' => __('Search Topics', 'bbpress'), 'not_found' => __('No topics found', 'bbpress'), 'not_found_in_trash' => __('No topics found in Trash', 'bbpress'), 'parent_item_colon' => __('Forum:', 'bbpress'));
     // Topic rewrite
     $post_type['rewrite'] = array('slug' => bbp_get_topic_slug(), 'with_front' => false);
     // Topic supports
     $post_type['supports'] = array('title', 'editor', 'revisions');
     // Register Topic content type
     register_post_type(bbp_get_topic_post_type(), apply_filters('bbp_register_topic_post_type', array('labels' => $post_type['labels'], 'rewrite' => $post_type['rewrite'], 'supports' => $post_type['supports'], 'description' => __('bbPress Topics', 'bbpress'), 'capabilities' => bbp_get_topic_caps(), 'capability_type' => array('topic', 'topics'), 'menu_position' => 555555, 'has_archive' => bbp_get_topic_archive_slug(), '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 ***********************************************************/
     // Reply labels
     $post_type['labels'] = array('name' => __('Replies', 'bbpress'), 'menu_name' => __('Replies', 'bbpress'), 'singular_name' => __('Reply', 'bbpress'), 'all_items' => __('All Replies', 'bbpress'), 'add_new' => __('New Reply', 'bbpress'), 'add_new_item' => __('Create New Reply', 'bbpress'), 'edit' => __('Edit', 'bbpress'), 'edit_item' => __('Edit Reply', 'bbpress'), 'new_item' => __('New Reply', 'bbpress'), 'view' => __('View Reply', 'bbpress'), 'view_item' => __('View Reply', 'bbpress'), 'search_items' => __('Search Replies', 'bbpress'), 'not_found' => __('No replies found', 'bbpress'), 'not_found_in_trash' => __('No replies found in Trash', 'bbpress'), 'parent_item_colon' => __('Topic:', 'bbpress'));
     // Reply rewrite
     $post_type['rewrite'] = array('slug' => bbp_get_reply_slug(), 'with_front' => false);
     // Reply supports
     $post_type['supports'] = array('title', 'editor', 'revisions');
     // Register reply content type
     register_post_type(bbp_get_reply_post_type(), apply_filters('bbp_register_reply_post_type', array('labels' => $post_type['labels'], 'rewrite' => $post_type['rewrite'], 'supports' => $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' => '')));
 }