Changeset 4482 for trunk/bp-core/bp-core-functions.php
- Timestamp:
- 06/10/2011 03:58:53 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-functions.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-functions.php
r4400 r4482 160 160 } 161 161 162 function bp_core_do_network_admin() { 163 $do_network_admin = false; 164 165 if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) ) 166 $do_network_admin = true; 167 168 return apply_filters( 'bp_core_do_network_admin', $do_network_admin ); 169 } 170 171 function bp_core_admin_hook() { 172 $hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu'; 173 174 return apply_filters( 'bp_core_admin_hook', $hook ); 175 } 176 162 177 /** 163 178 * Initializes the wp-admin area "BuddyPress" menus and sub menus. … … 169 184 if ( !is_super_admin() ) 170 185 return false; 186 187 add_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 ); 171 188 172 189 require ( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-admin.php' ); 173 190 } 174 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_admin_menu_init' );191 add_action( 'bp_init', 'bp_core_admin_menu_init' ); 175 192 176 193 /** … … 194 211 195 212 // Add the administration tab under the "Site Admin" tab for site administrators 196 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '', 2);213 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '', 4 ); 197 214 198 215 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Components', 'buddypress' ), __( 'Components', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup' ); … … 203 220 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 204 221 } 205 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_add_admin_menu', 9 );206 222 207 223 /** … … 225 241 return; 226 242 227 // On multisite installs, don't show on the Site Admin of a non-root blog 228 if ( !bp_is_root_blog() ) 243 // On multisite installs, don't show on the Site Admin of a non-root blog, unless 244 // do_network_admin is overridden 245 if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() ) 229 246 return; 230 247 … … 284 301 if ( !is_super_admin() ) 285 302 return; 286 287 // On multisite installs, don't log on a non-root blog 288 if ( !bp_is_root_blog() ) 303 304 // On multisite installs, don't load on a non-root blog, unless do_network_admin is 305 // overridden 306 if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() ) 289 307 return; 290 308 … … 361 379 } 362 380 363 $notice = sprintf( __( 'Some of your WordPress pages are linked to BuddyPress components that have been disabled. These pages may continue to show up in your site navigation. Consider <a href="%1$s">reactivating the components</a>, or unpublishing the pages: <strong>%2$s</strong>', 'buddypress' ), network_admin_url( 'admin.php?page=bp-general-settings' ), implode( ', ', $edit_pages_links ) ); 381 $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' ); 382 383 $notice = sprintf( __( 'Some of your WordPress pages are linked to BuddyPress components that have been disabled. These pages may continue to show up in your site navigation. Consider <a href="%1$s">reactivating the components</a>, or unpublishing the pages: <strong>%2$s</strong>', 'buddypress' ), $admin_url, implode( ', ', $edit_pages_links ) ); 364 384 365 385 bp_core_add_admin_notice( $notice ); … … 404 424 405 425 if ( !empty( $orphaned_components ) ) { 406 $notice = sprintf( __( 'Some BuddyPress components must be associated with WordPress pages for your site to work properly. The following components are missing their required WP pages: <strong>%1$s</strong>. Visit the <a href="%2$s">BuddyPress Components</a> panel, where you can either deactivate unused components or complete the page setup.', 'buddypress' ), implode( ', ', $orphaned_components ), network_admin_url( 'admin.php?page=bp-general-settings' ) ); 426 $admin_url = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=bp-general-settings' ) : admin_url( 'admin.php?page=bp-general-settings' ); 427 428 $notice = sprintf( __( 'Some BuddyPress components must be associated with WordPress pages for your site to work properly. The following components are missing their required WP pages: <strong>%1$s</strong>. Visit the <a href="%2$s">BuddyPress Components</a> panel, where you can either deactivate unused components or complete the page setup.', 'buddypress' ), implode( ', ', $orphaned_components ), $admin_url ); 407 429 408 430 bp_core_add_admin_notice( $notice );
Note: See TracChangeset
for help on using the changeset viewer.