public static function form_action_maintenance() { //Form action for all Headway configuration panels. Not in function/hook so it can load before everything else. if (!headway_post('headway-maintenance-nonce', false)) { return false; } //Check the nonce for security if (!wp_verify_nonce(headway_post('headway-maintenance-nonce', false), 'headway-maintenance-nonce')) { $GLOBALS['headway_admin_save_message'] = 'Security nonce did not match.'; return false; } //Load the maintenance class Headway::load('common/maintenance'); //Handle block repair if (headway_post('repair-blocks', false)) { HeadwayMaintenance::repair_blocks(); $GLOBALS['headway_admin_save_message'] = 'Blocks have successfully been repaired.'; } return true; }
/** * This will process upgrades from one version to another. **/ public static function maybe_db_upgrade() { $headway_settings = get_option('headway', array('version' => 0)); $db_version = $headway_settings['version']; /* If the version in the database is already up to date, then there are no upgrade functions to be ran. */ if (version_compare($db_version, HEADWAY_VERSION, '>=') || $db_version === 0) { return false; } Headway::load('common/maintenance'); return HeadwayMaintenance::db_upgrade($db_version); }