cptui_reserved_taxonomies

Return an array of names that users should not or can not use for taxonomy names.

Description

(array) cptui_reserved_taxonomies(); 

Returns (array)

$value Array of names that are recommended against.


Usage

  1. if ( !function_exists( 'cptui_reserved_taxonomies' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/taxonomies.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cptui_reserved_taxonomies(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/taxonomies.php  
  1. function cptui_reserved_taxonomies() { 
  2.  
  3. $reserved = array( 
  4. 'action',  
  5. 'attachment',  
  6. 'attachment_id',  
  7. 'author',  
  8. 'author_name',  
  9. 'calendar',  
  10. 'cat',  
  11. 'category',  
  12. 'category__and',  
  13. 'category__in',  
  14. 'category__not_in',  
  15. 'category_name',  
  16. 'comments_per_page',  
  17. 'comments_popup',  
  18. 'customize_messenger_channel',  
  19. 'customized',  
  20. 'cpage',  
  21. 'day',  
  22. 'debug',  
  23. error,  
  24. 'exact',  
  25. 'feed',  
  26. 'fields',  
  27. 'hour',  
  28. 'include',  
  29. 'link_category',  
  30. 'm',  
  31. 'minute',  
  32. 'monthnum',  
  33. 'more',  
  34. 'name',  
  35. 'nav_menu',  
  36. 'nonce',  
  37. 'nopaging',  
  38. 'offset',  
  39. 'order',  
  40. 'orderby',  
  41. 'p',  
  42. 'page',  
  43. 'page_id',  
  44. 'paged',  
  45. 'pagename',  
  46. 'pb',  
  47. 'perm',  
  48. 'post',  
  49. 'post__in',  
  50. 'post__not_in',  
  51. 'post_format',  
  52. 'post_mime_type',  
  53. 'post_status',  
  54. 'post_tag',  
  55. 'post_type',  
  56. 'posts',  
  57. 'posts_per_archive_page',  
  58. 'posts_per_page',  
  59. 'preview',  
  60. 'robots',  
  61. 's',  
  62. 'search',  
  63. 'second',  
  64. 'sentence',  
  65. 'showposts',  
  66. 'static',  
  67. 'subpost',  
  68. 'subpost_id',  
  69. 'tag',  
  70. 'tag__and',  
  71. 'tag__in',  
  72. 'tag__not_in',  
  73. 'tag_id',  
  74. 'tag_slug__and',  
  75. 'tag_slug__in',  
  76. 'taxonomy',  
  77. 'tb',  
  78. 'term',  
  79. 'theme',  
  80. 'type',  
  81. 'w',  
  82. 'withcomments',  
  83. 'withoutcomments',  
  84. 'year',  
  85. ); 
  86.  
  87. /** 
  88. * Filters the list of reserved post types to check against. 
  89. * 3rd party plugin authors could use this to prevent duplicate post types. 
  90. * @since 1.0.0 
  91. * @param array $value Array of post type slugs to forbid. 
  92. */ 
  93. $custom_reserved = apply_filters( 'cptui_reserved_taxonomies', array() ); 
  94.  
  95. if ( is_string( $custom_reserved ) && ! empty( $custom_reserved ) ) { 
  96. $reserved[] = $custom_reserved; 
  97. } else if ( is_array( $custom_reserved ) && ! empty( $custom_reserved ) ) { 
  98. foreach ( $custom_reserved as $slug ) { 
  99. $reserved[] = $slug; 
  100.  
  101. return $reserved;