Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. // Register Profiles
  2. function cpt_profiles() {
  3. $labels = array(
  4. 'name' => __( 'Profile', 'profile' ),
  5. 'singular_name' => __( 'Profile', 'profile' ),
  6. 'add_new' => __( 'Add Profile', 'profile' ),
  7. 'all_items' => __( 'All Profiles', 'profile' ),
  8. 'add_new_item' => __( 'Add New Profile', 'profile' ),
  9. 'edit_item' => __( 'Edit Profile', 'profile' ),
  10. 'new_item' => __( 'New Profile', 'profile' ),
  11. 'view_item' => __( 'View Profile', 'profile' ),
  12. 'search_items' => __( 'Search Profiles', 'profile' ),
  13. 'not_found' => __( 'No Profiles found', 'profile' ),
  14. 'not_found_in_trash' => __( 'No Profiles found in Trash', 'profile' ),
  15. 'parent_item_colon' => __( 'Parent Profile:', 'profile' ),
  16. 'menu_name' => __( 'Profiles', 'profile' ),
  17. );
  18. $rewrite = array(
  19. 'slug' => 'profile',
  20. 'with_front' => false,
  21. 'pages' => true,
  22. 'feeds' => true,
  23. );
  24. $args = array(
  25. 'labels' => $labels,
  26. 'hierarchical' => false,
  27. 'supports' => array( 'title', 'editor', 'author', 'revisions', 'thumbnail'),
  28. 'taxonomies' => array( 'profile_category'),
  29. 'public' => true,
  30. 'show_ui' => true,
  31. 'show_in_menu' => true,
  32. 'show_in_rest' => true,
  33. 'menu_position' => 10,
  34. 'menu_icon' => 'dashicons-universal-access',
  35. 'show_in_nav_menus' => false,
  36. 'publicly_queryable' => true,
  37. 'exclude_from_search' => false,
  38. 'has_archive' => true,
  39. 'query_var' => true,
  40. 'can_export' => true,
  41. 'rewrite' => $rewrite,
  42. 'capability_type' => 'post'
  43. );
  44.  
  45. register_post_type( 'profile', $args );
  46. }
  47. add_action( 'init', 'cpt_profiles' );
  48.  
  49. // Register Profile Areas
  50. function tax_profile_topics() {
  51.  
  52. $labels = array(
  53. 'name' => _x( 'Areas', 'Taxonomy General Name', 'text_domain' ),
  54. 'singular_name' => _x( 'Area', 'Taxonomy Singular Name', 'text_domain' ),
  55. 'menu_name' => __( 'Areas', 'text_domain' ),
  56. 'all_items' => __( 'All Items', 'text_domain' ),
  57. 'parent_item' => __( 'Parent Item', 'text_domain' ),
  58. 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
  59. 'new_item_name' => __( 'New Area', 'text_domain' ),
  60. 'add_new_item' => __( 'Add Area', 'text_domain' ),
  61. 'edit_item' => __( 'Edit Area', 'text_domain' ),
  62. 'update_item' => __( 'Update Area', 'text_domain' ),
  63. 'view_item' => __( 'View Area', 'text_domain' ),
  64. 'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
  65. 'add_or_remove_items' => __( 'Add or remove items', 'text_domain' ),
  66. 'choose_from_most_used' => __( 'Choose from the most used', 'text_domain' ),
  67. 'popular_items' => __( 'Popular Items', 'text_domain' ),
  68. 'search_items' => __( 'Search Items', 'text_domain' ),
  69. 'not_found' => __( 'Not Found', 'text_domain' ),
  70. 'no_terms' => __( 'No items', 'text_domain' ),
  71. 'items_list' => __( 'Items list', 'text_domain' ),
  72. 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
  73. );
  74. $args = array(
  75. 'labels' => $labels,
  76. 'hierarchical' => true,
  77. 'public' => true,
  78. 'show_ui' => true,
  79. 'show_admin_column' => true,
  80. 'show_in_nav_menus' => false,
  81. 'show_tagcloud' => false,
  82. );
  83. register_taxonomy( 'profile_category', array( 'profile' ), $args );
  84.  
  85. }
  86. add_action( 'init', 'tax_profile_topics');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement