Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/10/2011 03:58:53 PM (15 years ago)
Author:
boonebgorges
Message:

Introduces bp_core_do_network_admin() and bp_core_admin_hook() for better BP_ENABLE_MULTIBLOG and multinetwork admin support. Changes BP admin menu to load in slot 3, so as not to override Dashboard menu on site admin. Props wpmuguru for help testing and thinking through

File:
1 edited

Legend:

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

    r4466 r4482  
    1717 * @since {@internal Unknown}}
    1818 */
    19 function bp_core_admin_dashboard() { ?>
     19function bp_core_admin_dashboard() {
     20    $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' );
     21   
     22    $action = add_query_arg( array( 'page' => 'bp-general-settings' ), $base_url );
     23    ?>
    2024    <div class="wrap" id="bp-admin">
    2125
     
    2731        <?php do_action( 'bp_admin_notices' ); ?>
    2832
    29         <form action="<?php echo network_admin_url( 'admin.php?page=bp-general-settings' ) ?>" method="post" id="bp-admin-form">
     33        <form action="<?php echo $action ?>" method="post" id="bp-admin-form">
    3034            <div id="bp-admin-content">
    3135                <p>[TODO: All sorts of awesome things will go here. Latest plugins and themes, stats, version check, support topics, news, tips]</p>
     
    194198        }
    195199
    196         wp_redirect( network_admin_url( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), 'admin.php' ) ) );
     200        $base_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' );
     201
     202        wp_redirect( add_query_arg( array( 'page' => 'bp-general-settings', 'updated' => 'true' ), $base_url ) );
    197203    }
    198204}
     
    357363    global $bp;
    358364   
    359     if ( !bp_is_root_blog() ) {
    360         $bp->is_switched = 1;
    361         switch_to_blog( BP_ROOT_BLOG );
    362     }
    363        
    364365    // Get the existing WP pages
    365366    $existing_pages = bp_core_get_page_meta();
     
    449450
    450451    <?php
    451    
    452     if ( isset( $bp->is_switched ) ) {
    453         restore_current_blog();
    454         unset( $bp->is_switched );
    455     }
    456452}
    457453
Note: See TracChangeset for help on using the changeset viewer.