activeCustomPostType

Funcion para habilitar o desabilitar las taxonomias (portfolio, services, products.

Description

activeCustomPostType( $CustomPostType, $wtsPostType, (string) $wtsPostName ); 

. etc)en el dashboard

Parameters (3)

0. $customposttype
The CustomPostType.
1. $wtsposttype
The wtsPostType.
2. $wtspostname (string)
The wtsPostName.

Usage

  1. if ( !function_exists( 'activeCustomPostType' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The CustomPostType. 
  5. $customposttype = null; 
  6.  
  7. // The wtsPostType. 
  8. $wtsposttype = null; 
  9.  
  10. // The wtsPostName. 
  11. $wtspostname = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = activeCustomPostType($customposttype, $wtsposttype, $wtspostname); 
  15.  

Defined (1)

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

/functions.php  
  1. function activeCustomPostType($CustomPostType, $wtsPostType, $wtsPostName) { 
  2. global $wpdb; 
  3. if(get_option('themeshock_enablePostType'.$CustomPostType) === 'true'): 
  4. statusCustomPostType($wtsPostName, 'publish'); 
  5. add_action('init', $wtsPostType); 
  6. else: 
  7. statusCustomPostType($wtsPostName, 'trash'); 
  8. remove_action('init', $wtsPostType); 
  9. endif; 
  10.