Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //==========================================================================================
- // Community Posts =============================================================================
- //==========================================================================================
- function cws_register_community_post() {
- $labels = array(
- 'name' => _x( 'Community Posts', 'post type general name', 'cws' ),
- 'singular_name' => _x( 'Community Post', 'post type singular name', 'cws' ),
- 'add_new' => _x( 'Add New', 'community_post', 'cws' ),
- 'add_new_item' => __( 'Add New Community Post', 'cws' ),
- 'edit_item' => __( 'Edit Community Post', 'cws' ),
- 'new_item' => __( 'New Community Post', 'cws' ),
- 'all_items' => __( 'Community Posts', 'cws' ),
- 'view_item' => __( 'View Community Post', 'cws' ),
- 'search_items' => __( 'Search Community Posts', 'cws' ),
- 'not_found' => __( 'No Community Posts found', 'cws' ),
- 'not_found_in_trash' => __( 'No Community Posts found in the trash', 'cws' ),
- 'parent_item_colon' => '',
- 'menu_name' => 'Community Posts'
- );
- $args = array(
- 'labels' => $labels,
- 'description' => __( 'All Community Posts.', 'cws' ),
- 'public' => true,
- 'menu_position' => 25,
- 'show_in_menu' => 'community-menu',
- // 'hierarchical' => true,
- 'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
- 'has_archive' => false,
- 'rewrite' => array( 'slug' => 'community/%community_post_domain%', 'with_front' => false ),
- 'capability_type' => 'community_post',
- 'capabilities' => array(
- 'read_post' => 'read_community_posts',
- 'edit_post' => 'edit_community_posts',
- 'delete_post' => 'delete_community_posts',
- ),
- );
- register_post_type( 'community_post', $args );
- }
- add_action( 'init', 'cws_register_community_post' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement