예제 #1
0
<?php

/** 
 * Patch for adding new custom page
 */
mgm_create_custom_pages(true);
// end patch
예제 #2
0
 function activate()
 {
     global $wpdb;
     // get auth
     $auth = mgm_get_class('auth');
     // verify key
     if ($auth->verify()) {
         // migration once / it will take care
         require_once 'migration/mgm_migrate.php';
         // check and set each schedules
         foreach (mgm_get_defined_schedules() as $schedule_name => $event_name) {
             // set up daily cron event, once
             if (!wp_next_scheduled($event_name)) {
                 // add
                 wp_schedule_event(time(), $schedule_name, $event_name);
                 // the name of event/schedule hook
             }
         }
         // create pages run always now, only when new pages added it will execute
         mgm_create_custom_pages();
         // run others once
         if (!get_option('mgm_version') || version_compare(get_option('mgm_upgrade_id'), '1.8', '<')) {
             // add version/upgrade compare, transaction added on 1.8 and pages later
             // create pages
             // mgm_create_custom_pages();
             // enable active modules
             $payment_modules = mgm_get_class('system')->get_active_modules('payment');
             // active modules
             if ($payment_modules) {
                 // loop
                 foreach ($payment_modules as $module) {
                     // install modules
                     mgm_get_module($module, 'payment')->enable();
                     // enable only
                 }
             }
             // update
             update_option('mgm_version', $auth->get_product_info('product_version'));
             // version
             update_option('mgm_build', $auth->get_product_info('product_build'));
             // build
         }
     }
 }