Skip to:
Content

BuddyPress.org

Changeset 8592


Ignore:
Timestamp:
07/11/2014 01:40:30 PM (12 years ago)
Author:
johnjamesjacoby
Message:

bp_blogs_record_existing_blogs() is too taxing of a routine to be called from inside bp_core_activation_notice() (which is responsible for notices beyond just activation) so remove it for now (and refactor a bit of the preceding logic too.)

We'll relocate this function call to a more appropriate location soon. See #5749.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-functions.php

    r8431 r8592  
    201201 */
    202202function bp_core_activation_notice() {
    203         global $wpdb, $wp_rewrite;
    204 
    205         $bp = buddypress();
     203        global $wp_rewrite;
    206204
    207205        // Only the super admin gets warnings
     
    210208        }
    211209
     210        // Bail in user admin
     211        if ( is_user_admin() ) {
     212                return;
     213        }
     214
    212215        // On multisite installs, don't load on a non-root blog, unless do_network_admin is overridden
    213         if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() ) {
     216        if ( is_multisite() && bp_core_do_network_admin() && ! bp_is_root_blog() ) {
    214217                return;
    215218        }
     
    220223        }
    221224
    222         // Bail in network admin
    223         if ( is_user_admin() ) {
    224                 return;
    225         }
    226 
    227         /**
    228          * Check to make sure that the blog setup routine has run. This can't happen during the
    229          * wizard because of the order which the components are loaded. We check for multisite here
    230          * on the off chance that someone has activated the blogs component and then disabled MS
    231          */
    232         if ( bp_is_active( 'blogs' ) ) {
    233                 $count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" );
    234 
    235                 if ( empty( $count ) ) {
    236                         bp_blogs_record_existing_blogs();
    237                 }
    238         }
    239 
    240         /**
    241          * Are pretty permalinks enabled?
    242          */
    243         if ( isset( $_POST['permalink_structure'] ) ) {
    244                 return;
    245         }
    246 
     225        // Add notice if no rewrite rules are enabled
    247226        if ( empty( $wp_rewrite->permalink_structure ) ) {
    248227                bp_core_add_admin_notice( sprintf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ) );
    249228        }
     229
     230        // Get BuddyPress instance
     231        $bp = buddypress();
    250232
    251233        /**
Note: See TracChangeset for help on using the changeset viewer.