Changeset 10356 for trunk/src/bp-core/bp-core-adminbar.php
- Timestamp:
- 11/15/2015 07:57:03 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-adminbar.php
r10108 r10356 17 17 * @since 1.6.0 18 18 * 19 * @global WP_Admin_Bar $wp_admin_bar 19 * @global WP_Admin_Bar $wp_admin_bar. 20 20 */ 21 21 function bp_admin_bar_my_account_root() { 22 22 global $wp_admin_bar; 23 23 24 // Bail if this is an ajax request 24 // Bail if this is an ajax request. 25 25 if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) 26 26 return; 27 27 28 // Only add menu for logged in user 28 // Only add menu for logged in user. 29 29 if ( is_user_logged_in() ) { 30 30 31 // Add secondary parent item for all BuddyPress components 31 // Add secondary parent item for all BuddyPress components. 32 32 $wp_admin_bar->add_menu( array( 33 33 'parent' => 'my-account', … … 40 40 ) ); 41 41 42 // Remove 'Edit' post link as it's not applicable to BP 43 // Remove when https://core.trac.wordpress.org/ticket/29538 is addressed 42 // Remove 'Edit' post link as it's not applicable to BP. 43 // Remove when https://core.trac.wordpress.org/ticket/29538 is addressed. 44 44 if ( is_buddypress() ) { 45 45 $wp_admin_bar->remove_node( 'edit' ); … … 69 69 function bp_core_load_admin_bar() { 70 70 71 // Show the Toolbar for logged out users 71 // Show the Toolbar for logged out users. 72 72 if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) { 73 73 show_admin_bar( true ); 74 74 } 75 75 76 // Hide the WordPress Toolbar and show the BuddyBar 76 // Hide the WordPress Toolbar and show the BuddyBar. 77 77 if ( ! bp_use_wp_admin_bar() ) { 78 78 _doing_it_wrong( __FUNCTION__, __( 'The BuddyBar is no longer supported. Please migrate to the WordPress toolbar as soon as possible.', 'buddypress' ), '2.1.0' ); 79 79 80 // Keep the WP Toolbar from loading 80 // Keep the WP Toolbar from loading. 81 81 show_admin_bar( false ); 82 82 83 // Actions used to build the BP Toolbar 83 // Actions used to build the BP Toolbar. 84 84 add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' ); 85 85 add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 ); … … 88 88 add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 ); 89 89 90 // Actions used to append BP Toolbar to footer 90 // Actions used to append BP Toolbar to footer. 91 91 add_action( 'wp_footer', 'bp_core_admin_bar', 8 ); 92 92 add_action( 'admin_footer', 'bp_core_admin_bar' ); … … 125 125 } 126 126 127 // Enqueue the additional adminbar css 127 // Enqueue the additional adminbar css. 128 128 wp_enqueue_style( 'bp-admin-bar' ); 129 129 }
Note: See TracChangeset
for help on using the changeset viewer.