cptui_process_taxonomy

Handle the save and deletion of taxonomy data.

Description

cptui_process_taxonomy(); 

Usage

  1. if ( !function_exists( 'cptui_process_taxonomy' ) ) { 
  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_process_taxonomy(); 
  7.  

Defined (1)

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

/inc/taxonomies.php  
  1. function cptui_process_taxonomy() { 
  2.  
  3. if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { 
  4. return; 
  5.  
  6. if ( ! is_admin() ) { 
  7. return; 
  8.  
  9. if ( ! empty( $_GET ) && isset( $_GET['page'] ) && 'cptui_manage_taxonomies' !== $_GET['page'] ) { 
  10. return; 
  11.  
  12. if ( ! empty( $_POST ) ) { 
  13. $result = ''; 
  14. if ( isset( $_POST['cpt_submit'] ) ) { 
  15. check_admin_referer( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' ); 
  16. $result = cptui_update_taxonomy( $_POST ); 
  17. } elseif ( isset( $_POST['cpt_delete'] ) ) { 
  18. check_admin_referer( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' ); 
  19. $result = cptui_delete_taxonomy( $_POST ); 
  20. add_filter( 'cptui_taxonomy_deleted', '__return_true' ); 
  21. if ( $result ) { 
  22. add_action( 'admin_notices', "cptui_{$result}_admin_notice" );