/**
 * Set up Achievements' updater
 *
 * @since 3.0
 */
function dpa_setup_updater()
{
    // Are we running an outdated version of Achievements?
    if (dpa_is_update()) {
        // Bump the version
        dpa_version_bump();
        // Run the deactivation function to wipe roles, caps, and rewrite rules
        dpa_deactivation();
        // Run the activation function to reset roles, caps, and rewrite rules
        dpa_activation();
    }
}
Example #2
0
/**
 * Achievements' version updater looks at what the current database version is and
 * runs whatever other code is needed.
 *
 * This is most-often used when the data schema changes, but should also be used
 * to correct issues with Achievements meta-data silently on software update.
 *
 * @since Achievements (3.0)
 */
function dpa_version_updater()
{
    // Get the raw database version
    $raw_db_version = (int) dpa_get_db_version_raw();
    // Chill; there's nothing to do for now!
    // Bump the version
    dpa_version_bump();
    // Delete rewrite rules to force a flush
    dpa_delete_rewrite_rules();
}