Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //==========================================================================================
- // Community Post Type & Domain =============================================================
- //==========================================================================================
- function create_community_post_taxonomies() {
- $domainArgs = array(
- 'show_ui' => true,
- 'hierarchical' => true,
- 'show_in_menu' => 'community-menu',
- 'show_admin_column' => true,
- 'labels' => array(
- 'name' => _x( 'Community Post Domains', 'taxonomy general name', 'cws' ),
- 'singular_name' => _x( 'Community Post Domain', 'taxonomy singular name', 'cws' ),
- 'add_new_item' => __( 'Add New Community Post Domain', 'cws' ),
- 'new_item_name' => __( 'New Community Post Domain', 'cws' ),
- ),
- 'capabilities' => array(
- 'manage_terms' => 'edit_community_posts',
- 'edit_terms' => 'edit_community_posts',
- 'delete_terms' => 'edit_community_posts',
- 'assign_terms' => 'edit_community_posts',
- ),
- );
- $typeArgs = array(
- 'show_ui' => true,
- 'hierarchical' => true,
- 'show_in_menu' => 'community-menu',
- 'show_admin_column' => true,
- 'labels' => array(
- 'name' => _x( 'Community Post Types', 'taxonomy general name', 'cws' ),
- 'singular_name' => _x( 'Community Post Type', 'taxonomy singular name', 'cws' ),
- 'add_new_item' => __( 'Add New Community Post Type', 'cws' ),
- 'new_item_name' => __( 'New Community Post Type', 'cws' ),
- ),
- 'capabilities' => array(
- 'manage_terms' => 'edit_community_posts',
- 'edit_terms' => 'edit_community_posts',
- 'delete_terms' => 'edit_community_posts',
- 'assign_terms' => 'edit_community_posts',
- ),
- 'rewrite' => array( 'slug' => 'community', 'with_front' => false ),
- );
- register_taxonomy( 'community_post_type', 'community_post', $typeArgs );
- register_taxonomy( 'community_post_domain', 'community_post', $domainArgs );
- }
- add_action( 'init', 'create_community_post_taxonomies' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement