ddw_wcde_unique_plugin_check

Helper function for checking supported plugins by checking against unique classes, constants or functions.

Description

ddw_wcde_unique_plugin_check( (string) $identifier ); 

Parameters (1)

0. $identifier (string)
Name of a unique class, constant or function.

Usage

  1. if ( !function_exists( 'ddw_wcde_unique_plugin_check' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/includes/wcde-functions.php'; 
  3.  
  4. // Name of a unique class, constant or function. 
  5. $identifier = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ddw_wcde_unique_plugin_check($identifier); 
  9.  

Defined (1)

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

/includes/wcde-functions.php  
  1. function ddw_wcde_unique_plugin_check( $identifier ) { 
  2.  
  3. $output = 'default'; 
  4.  
  5. /** Check any unique class name */ 
  6. if ( class_exists( esc_attr( $identifier ) ) ) { 
  7.  
  8. $output = TRUE; 
  9.  
  10.  
  11. /** Check any unique constant name */ 
  12. elseif ( defined( esc_attr( $identifier ) ) ) { 
  13.  
  14. $output = TRUE; 
  15.  
  16.  
  17. /** Check any unique function name */ 
  18. elseif ( function_exists( esc_attr( $identifier ) ) ) { 
  19.  
  20. $output = TRUE; 
  21.  
  22. } // end if 
  23.  
  24. /** Return the function */ 
  25. return $output; 
  26.  
  27. } // end of function ddw_wcde_unique_plugin_check