cptui_get_preserved_keys

Return array of keys needing preserved.

Description

(array) cptui_get_preserved_keys( (string) $type = '' ); 

Returns (array)

Array of keys needing preservered for the requested type.

Parameters (1)

0. $type — Optional. (string) => ''
Type to return. Either post_types or taxonomies.. Optional. Default empty string.

Usage

  1. if ( !function_exists( 'cptui_get_preserved_keys' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/custom-post-type-ui.php'; 
  3.  
  4. // Type to return. Either 'post_types' or 'taxonomies'. Optional. Default empty string. 
  5. $type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = cptui_get_preserved_keys($type); 
  9.  

Defined (1)

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

/custom-post-type-ui.php  
  1. function cptui_get_preserved_keys( $type = '' ) { 
  2.  
  3. $preserved_labels = array( 
  4. 'post_types' => array( 
  5. 'add_new_item',  
  6. 'edit_item',  
  7. 'new_item',  
  8. 'view_item',  
  9. 'all_items',  
  10. 'search_items',  
  11. 'not_found',  
  12. 'not_found_in_trash',  
  13. ),  
  14. 'taxonomies' => array( 
  15. 'search_items',  
  16. 'popular_items',  
  17. 'all_items',  
  18. 'parent_item',  
  19. 'parent_item_colon',  
  20. 'edit_item',  
  21. 'update_item',  
  22. 'add_new_item',  
  23. 'new_item_name',  
  24. 'separate_items_with_commas',  
  25. 'add_or_remove_items',  
  26. 'choose_from_most_used',  
  27. ),  
  28. ); 
  29. return ( ! empty( $type ) ) ? $preserved_labels[ $type ] : array();