Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/22/2012 10:16:40 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Forum Visibility:

  • Prevent forum metaboxes from saving forum revisions as private/hidden.
  • Add repair function for private/hidden forums to Tools.
  • Add updater for 2.1.1, and run the visibility repair function.
  • Fixes #1891.
  • For 2.2 branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-update.php

    r3964 r4105  
    140140    // Are we running an outdated version of bbPress?
    141141    if ( bbp_is_update() ) {
     142
     143        // Call the automated updater
     144        bbp_version_updater();
    142145
    143146        // Bump the version
     
    210213    );
    211214}
     215
     216/**
     217 * bbPress's version updater looks at what the current database version is, and
     218 * runs whatever other code is needed.
     219 *
     220 * This is most-often used when the data schema changes, but should also be used
     221 * to correct issues with bbPress meta-data silently on software update.
     222 *
     223 * @since bbPress (r4104)
     224 */
     225function bbp_version_updater() {
     226
     227    // Get the raw database version
     228    $raw_db_version = (int) bbp_get_db_version_raw();
     229
     230    // Bail if no database version exists
     231    if ( empty( $raw_db_version ) )
     232        return;
     233
     234    /** 2.0 Branch ************************************************************/
     235
     236    // 2.0, 2.0.1, 2.0.2, 2.0.3
     237    if ( $raw_db_version < 200 ) {
     238        // Do nothing
     239    }
     240
     241    /** 2.1 Branch ************************************************************/
     242
     243    // 2.1, 2.1.1
     244    if ( $raw_db_version < 211 ) {
     245
     246        /**
     247         * Repair private and hidden forum data
     248         *
     249         * @link http://bbpress.trac.wordpress.org/ticket/1891
     250         */
     251        bbp_admin_repair_forum_visibility();
     252    }
     253
     254    /** 2.2 Branch ************************************************************/
     255
     256    // 2.2
     257    if ( $raw_db_version < 220 ) {
     258        // No changes yet
     259    }
     260}
Note: See TracChangeset for help on using the changeset viewer.