pmpro_upgrade_1_2_3

The Paid Memberships Pro pmpro upgrade 1 2 3 function.

Description

pmpro_upgrade_1_2_3(); 

Usage

  1. if ( !function_exists( 'pmpro_upgrade_1_2_3' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/updates/upgrade_1_2_3.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_upgrade_1_2_3(); 
  7.  

Defined (1)

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

/includes/updates/upgrade_1_2_3.php  
  1. function pmpro_upgrade_1_2_3() 
  2. global $wpdb; 
  3. $wpdb->hide_errors(); 
  4. $wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels'; 
  5. $wpdb->pmpro_memberships_users = $wpdb->prefix . 'pmpro_memberships_users'; 
  6. $wpdb->pmpro_memberships_categories = $wpdb->prefix . 'pmpro_memberships_categories'; 
  7. $wpdb->pmpro_memberships_pages = $wpdb->prefix . 'pmpro_memberships_pages'; 
  8. $wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders'; 
  9. $wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes'; 
  10. $wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels'; 
  11. $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses'; 
  12.  
  13. //expiration number and period for levels 
  14. $sqlQuery = " 
  15. ALTER TABLE `" . $wpdb->pmpro_membership_levels . "` ADD `expiration_number` INT UNSIGNED NOT NULL ,  
  16. ADD `expiration_period` ENUM( 'Day', 'Week', 'Month', 'Year' ) NOT NULL 
  17. "; 
  18. $wpdb->query($sqlQuery); 
  19.  
  20. //expiration number and period fordiscountcode levels 
  21. $sqlQuery = " 
  22. ALTER TABLE `" . $wpdb->pmpro_discount_codes_levels . "` ADD `expiration_number` INT UNSIGNED NOT NULL ,  
  23. ADD `expiration_period` ENUM( 'Day', 'Week', 'Month', 'Year' ) NOT NULL 
  24. "; 
  25. $wpdb->query($sqlQuery); 
  26.  
  27. //end date for members 
  28. $sqlQuery = " 
  29. ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD `enddate` DATETIME NULL AFTER `startdate` 
  30. "; 
  31. $wpdb->query($sqlQuery); 
  32.  
  33. $sqlQuery = " 
  34. ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD INDEX ( `enddate` ) 
  35. "; 
  36. $wpdb->query($sqlQuery); 
  37.  
  38. pmpro_setOption("db_version", "1.23"); 
  39. return 1.23;