Advertisement
ncamaa1

Untitled

Sep 26th, 2021
1,231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.03 KB | None | 0 0
  1. <?php
  2. //==========================================================================================
  3. // Community Post Type & Domain =============================================================
  4. //==========================================================================================
  5.  
  6. function create_community_post_taxonomies() {
  7.     $domainArgs = array(
  8.         'show_ui'            => true,
  9.         'hierarchical'       => true,
  10.         'show_in_menu'       => 'community-menu',
  11.         'show_admin_column'  => true,
  12.  
  13.         'labels' => array(
  14.             'name'          => _x( 'Community Post Domains', 'taxonomy general name', 'cws' ),
  15.             'singular_name' => _x( 'Community Post Domain', 'taxonomy singular name', 'cws' ),
  16.             'add_new_item'  => __( 'Add New Community Post Domain', 'cws' ),
  17.             'new_item_name' => __( 'New Community Post Domain', 'cws' ),
  18.         ),
  19.  
  20.         'capabilities' => array(
  21.             'manage_terms' => 'edit_community_posts',
  22.             'edit_terms'   => 'edit_community_posts',
  23.             'delete_terms' => 'edit_community_posts',
  24.             'assign_terms' => 'edit_community_posts',
  25.         ),
  26.     );
  27.  
  28.     $typeArgs = array(
  29.         'show_ui'            => true,
  30.         'hierarchical'       => true,
  31.         'show_in_menu'       => 'community-menu',
  32.         'show_admin_column'  => true,
  33.  
  34.         'labels'  => array(
  35.             'name'          => _x( 'Community Post Types', 'taxonomy general name', 'cws' ),
  36.             'singular_name' => _x( 'Community Post Type', 'taxonomy singular name', 'cws' ),
  37.             'add_new_item'  => __( 'Add New Community Post Type', 'cws' ),
  38.             'new_item_name' => __( 'New Community Post Type', 'cws' ),
  39.         ),
  40.  
  41.         'capabilities' => array(
  42.             'manage_terms' => 'edit_community_posts',
  43.             'edit_terms'   => 'edit_community_posts',
  44.             'delete_terms' => 'edit_community_posts',
  45.             'assign_terms' => 'edit_community_posts',
  46.         ),
  47.  
  48.         'rewrite' => array( 'slug' => 'community', 'with_front' => false ),
  49.  
  50.     );
  51.     register_taxonomy( 'community_post_type', 'community_post', $typeArgs );
  52.     register_taxonomy( 'community_post_domain', 'community_post', $domainArgs );
  53. }
  54. add_action( 'init', 'create_community_post_taxonomies' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement