Ejemplo n.º 1
0
/**
 * bbPress's 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 bbPress meta-data silently on software update.
 *
 * @since bbPress (r4104)
 */
function bbp_version_updater()
{
    // Get the raw database version
    $raw_db_version = (int) bbp_get_db_version_raw();
    /** 2.0 Branch ************************************************************/
    // 2.0, 2.0.1, 2.0.2, 2.0.3
    if ($raw_db_version < 200) {
        // No changes
    }
    /** 2.1 Branch ************************************************************/
    // 2.1, 2.1.1
    if ($raw_db_version < 211) {
        /**
         * Repair private and hidden forum data
         *
         * @link http://bbpress.trac.wordpress.org/ticket/1891
         */
        bbp_admin_repair_forum_visibility();
    }
    /** 2.2 Branch ************************************************************/
    // 2.2
    if ($raw_db_version < 220) {
        // Remove the Moderator role from the database
        remove_role(bbp_get_moderator_role());
        // Remove the Participant role from the database
        remove_role(bbp_get_participant_role());
        // Remove capabilities
        bbp_remove_caps();
    }
    /** 2.3 Branch ************************************************************/
    // 2.3
    if ($raw_db_version < 230) {
        // No changes
    }
    /** All done! *************************************************************/
    // Bump the version
    bbp_version_bump();
    // Delete rewrite rules to force a flush
    bbp_delete_rewrite_rules();
}
Ejemplo n.º 2
0
/**
 * bbPress's 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 bbPress meta-data silently on software update.
 *
 * @since bbPress (r4104)
 */
function bbp_version_updater()
{
    // Get the raw database version
    $raw_db_version = (int) bbp_get_db_version_raw();
    /** 2.0 Branch ************************************************************/
    // 2.0, 2.0.1, 2.0.2, 2.0.3
    if ($raw_db_version < 200) {
        // Do nothing
    }
    /** 2.1 Branch ************************************************************/
    // 2.1, 2.1.1
    if ($raw_db_version < 211) {
        /**
         * Repair private and hidden forum data
         *
         * @link http://bbpress.trac.wordpress.org/ticket/1891
         */
        bbp_admin_repair_forum_visibility();
    }
    /** 2.2 Branch ************************************************************/
    // 2.2
    if ($raw_db_version < 214) {
        // Remove bbPress 1.1 roles (BuddyPress)
        remove_role('member');
        remove_role('inactive');
        remove_role('blocked');
        remove_role('moderator');
        remove_role('keymaster');
        // Remove bbPress 2.1 roles
        remove_role('bbp_moderator');
        remove_role('bbp_participant');
        // Refresh capabilities
        bbp_remove_caps();
        bbp_add_caps();
    }
    /** All done! *************************************************************/
    // Bump the version
    bbp_version_bump();
    // Delete rewrite rules to force a flush
    bbp_delete_rewrite_rules();
}
Ejemplo n.º 3
0
/**
 * bbPress's 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 bbPress meta-data silently on software update.
 *
 * @since bbPress (r4104)
 */
function bbp_version_updater()
{
    // Get the raw database version
    $raw_db_version = (int) bbp_get_db_version_raw();
    // Bail if no database version exists
    if (empty($raw_db_version)) {
        return;
    }
    /** 2.0 Branch ************************************************************/
    // 2.0, 2.0.1, 2.0.2, 2.0.3
    if ($raw_db_version < 200) {
        // Do nothing
    }
    /** 2.1 Branch ************************************************************/
    // 2.1, 2.1.1
    if ($raw_db_version < 211) {
        /**
         * Repair private and hidden forum data
         *
         * @link http://bbpress.trac.wordpress.org/ticket/1891
         */
        bbp_admin_repair_forum_visibility();
    }
    /** 2.2 Branch ************************************************************/
    // 2.2
    if ($raw_db_version < 220) {
        // No changes yet
    }
}
Ejemplo n.º 4
0
/**
 * bbPress's 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 bbPress meta-data silently on software update.
 *
 * @since 2.2.0 bbPress (r4104)
 */
function bbp_version_updater()
{
    // Get the raw database version
    $raw_db_version = (int) bbp_get_db_version_raw();
    // Only run updater if previous installation exists
    if (!empty($raw_db_version)) {
        /** 2.0 Branch ********************************************************/
        // 2.0, 2.0.1, 2.0.2, 2.0.3
        if ($raw_db_version < 200) {
            // No changes
        }
        /** 2.1 Branch ********************************************************/
        // 2.1, 2.1.1
        if ($raw_db_version < 211) {
            /**
             * Repair private and hidden forum data
             *
             * @link https://bbpress.trac.wordpress.org/ticket/1891
             */
            bbp_admin_repair_forum_visibility();
        }
        /** 2.2 Branch ********************************************************/
        // 2.2
        if ($raw_db_version < 220) {
            // Remove any old bbPress roles
            bbp_remove_roles();
            // Remove capabilities
            bbp_remove_caps();
        }
        /** 2.3 Branch ********************************************************/
        // 2.3
        if ($raw_db_version < 230) {
            // No changes
        }
    }
    /** All done! *************************************************************/
    // Bump the version
    bbp_version_bump();
    // Delete rewrite rules to force a flush
    bbp_delete_rewrite_rules();
}