cptui_not_new_install

Mark site as not a new CPTUI install upon update to 1.5.0.

Description

cptui_not_new_install( (object) $wp_upgrader, (array) $extras ); 

Parameters (2)

0. $wp_upgrader (object)
WP_Upgrader instance.
1. $extras (array)
Extra information about performed upgrade.

Usage

  1. if ( !function_exists( 'cptui_not_new_install' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/utility.php'; 
  3.  
  4. // WP_Upgrader instance. 
  5. $wp_upgrader = null; 
  6.  
  7. // Extra information about performed upgrade. 
  8. $extras = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = cptui_not_new_install($wp_upgrader, $extras); 
  12.  

Defined (1)

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

/inc/utility.php  
  1. function cptui_not_new_install( $wp_upgrader, $extras ) { 
  2.  
  3. if ( ! is_a( $wp_upgrader, 'Plugin_Upgrader' ) ) { 
  4. return; 
  5.  
  6. if ( ! array_key_exists( 'plugins', $extras ) || ! is_array( $extras['plugins'] ) ) { 
  7. return; 
  8.  
  9. // Was CPTUI updated? 
  10. if ( ! in_array( 'custom-post-type-ui/custom-post-type-ui.php', $extras['plugins'] ) ) { 
  11. return; 
  12.  
  13. // If we are already known as not new, return. 
  14. if ( cptui_is_new_install() ) { 
  15. return; 
  16.  
  17. // We need to mark ourselves as not new.