pods_upgrade

Include and Init the PodsUpgrade class.

Description

pods_upgrade( (string) $version = '' ); 

Parameters (1)

0. $version — Optional. (string) => ''
Version number of upgrade to get

Usage

  1. if ( !function_exists( 'pods_upgrade' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/includes/classes.php'; 
  3.  
  4. // Version number of upgrade to get 
  5. $version = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pods_upgrade($version); 
  9.  

Defined (1)

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

/includes/classes.php  
  1. function pods_upgrade ( $version = '' ) { 
  2. include_once PODS_DIR . 'sql/upgrade/PodsUpgrade.php'; 
  3.  
  4. $class_name = str_replace( '.', '_', $version ); 
  5. $class_name = "PodsUpgrade_{$class_name}"; 
  6.  
  7. $class_name = trim( $class_name, '_' ); 
  8.  
  9. if ( !class_exists( $class_name ) ) { 
  10. $file = PODS_DIR . 'sql/upgrade/' . basename( $class_name ) . '.php'; 
  11.  
  12. if ( file_exists( $file ) ) 
  13. include_once $file; 
  14.  
  15. $class = false; 
  16.  
  17. if ( class_exists( $class_name ) ) 
  18. $class = new $class_name(); 
  19.  
  20. return $class;