Skip to:
Content

BuddyPress.org

Changeset 5015


Ignore:
Timestamp:
08/19/2011 01:48:06 PM (13 years ago)
Author:
boonebgorges
Message:

Removes 'deactivated' gloss from Pages dashboard panel, since deactivated components will never show up on that page after r4290. Removes the 'orphaned WP pages' admin notice, which cannot (and need not) be repaired after r4290. Fixes #3474

Location:
trunk/bp-core
Files:
2 edited

Legend:

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

    r5002 r5015  
    500500                <tr valign="top">
    501501                    <th scope="row">
    502                         <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?><?php if ( !bp_is_active( $name ) ) : ?> <span class="description">(deactivated)</span><?php endif ?></label>
     502                        <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
    503503                    </th>
    504504
  • trunk/bp-core/bp-core-functions.php

    r4965 r5015  
    381381    if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', (array)$ct->tags ) ) {
    382382        bp_core_add_admin_notice( sprintf( __( "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), network_admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), network_admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) );
    383     }
    384 
    385     /**
    386      * Check for orphaned directory pages (BP component is disabled, WP page exists)
    387      */
    388 
    389     $orphaned_pages = array();
    390     foreach( $bp->pages as $component_id => $page ) {
    391 
    392         // Some members of $bp->pages will not have corresponding $bp->{component}, so we
    393         // skip them. Plugins can add themselves here if necessary.
    394         $exceptions = apply_filters( 'bp_pages_without_components', array( 'register', 'activate' ) );
    395         if ( in_array( $component_id, $exceptions ) )
    396             continue;
    397 
    398         if ( !isset( $bp->{$component_id} ) ) {
    399             // We'll need to get some more information about the page for the notice
    400             $page_data = get_post( $page->id );
    401 
    402             $orphaned_pages[] = array(
    403                 'id'    => $page_data->ID,
    404                 'title' => $page_data->post_title
    405             );
    406         }
    407 
    408     }
    409 
    410     // If orphaned pages are found, post a notice about them.
    411     if ( !empty( $orphaned_pages ) ) {
    412 
    413         // Create the string of links to the Edit Page screen for the pages
    414         $edit_pages_links = array();
    415         foreach( $orphaned_pages as $op )
    416             $edit_pages_links[] = sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'post.php?action=edit&post=' . $op['id'] ), $op['title'] );
    417 
    418         $admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
    419         $notice    = sprintf( __( 'Some of your WordPress pages are linked to BuddyPress Components that are disabled: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $edit_pages_links ) . '</strong>' );
    420 
    421         bp_core_add_admin_notice( $notice );
    422383    }
    423384
Note: See TracChangeset for help on using the changeset viewer.