Changeset 13741
- Timestamp:
- 02/23/2024 03:16:00 AM (9 months ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-adminbar.php
r13395 r13741 24 24 25 25 // Bail if this is an ajax request. 26 if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) )26 if ( wp_doing_ajax() ) { 27 27 return; 28 } 28 29 29 30 // Only add menu for logged in user. … … 54 55 show_admin_bar( true ); 55 56 } 56 57 // Hide the WordPress Toolbar.58 if ( ! bp_use_wp_admin_bar() ) {59 // Keep the WP Toolbar from loading.60 show_admin_bar( false );61 }62 57 } 63 58 add_action( 'init', 'bp_core_load_admin_bar', 9 ); … … 87 82 function bp_core_enqueue_admin_bar_css() { 88 83 89 // Bail if not using WordPress's admin bar or it's not showing on this 90 // page request. 91 if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() ) { 84 // Bail if WordPress's admin bar is not showing on this page request. 85 if ( ! is_admin_bar_showing() ) { 92 86 return; 93 87 } -
trunk/src/bp-core/bp-core-dependency.php
r13490 r13741 191 191 */ 192 192 function bp_setup_admin_bar() { 193 if ( bp_use_wp_admin_bar() ) { 194 195 /** 196 * Fires inside the 'bp_setup_admin_bar' function, where plugins should add items to the WP admin bar. 197 * 198 * This hook will only fire if bp_use_wp_admin_bar() returns true. 199 * 200 * @since 1.5.0 201 */ 202 do_action( 'bp_setup_admin_bar', array() ); 203 } 193 /** 194 * Fires inside the 'bp_setup_admin_bar' function, where plugins should add items to the WP admin bar. 195 * 196 * @since 1.5.0 197 */ 198 do_action( 'bp_setup_admin_bar', array() ); 204 199 } 205 200 -
trunk/src/bp-core/bp-core-functions.php
r13718 r13741 498 498 */ 499 499 return apply_filters( 'bp_is_username_compatibility_mode', defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) && BP_ENABLE_USERNAME_COMPATIBILITY_MODE ); 500 }501 502 /**503 * Should we use the WP Toolbar?504 *505 * The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as506 * of BP 1.5. For BP 1.6, the WP Toolbar is the default.507 *508 * @since 1.5.0509 *510 * @return bool Default: true. False when WP Toolbar support is disabled.511 */512 function bp_use_wp_admin_bar() {513 514 // Default to true.515 $use_admin_bar = true;516 517 // Has the WP Toolbar constant been explicitly opted into?518 if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {519 $use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;520 }521 522 /**523 * Filters whether or not to use the admin bar.524 *525 * @since 1.5.0526 *527 * @param bool $use_admin_bar Whether or not to use the admin bar.528 */529 return (bool) apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar );530 500 } 531 501 -
trunk/src/bp-core/classes/class-bp-component.php
r13662 r13741 808 808 809 809 // Bail if this is an ajax request. 810 if ( defined( 'DOING_AJAX' ) ) { 811 return; 812 } 813 814 // Do not proceed if BP_USE_WP_ADMIN_BAR constant is not set or is false. 815 if ( ! bp_use_wp_admin_bar() ) { 810 if ( wp_doing_ajax() ) { 816 811 return; 817 812 } -
trunk/src/bp-core/deprecated/14.0.php
r13718 r13741 32 32 _deprecated_function( __FUNCTION__, '14.0.0' ); 33 33 } 34 35 /** 36 * Should we use the WP Toolbar? 37 * 38 * The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as 39 * of BP 1.5. For BP 1.6, the WP Toolbar is the default. 40 * 41 * @since 1.5.0 42 * @deprecated 14.0.0 43 * 44 * @return bool Default: true. False when WP Toolbar support is disabled. 45 */ 46 function bp_use_wp_admin_bar() { 47 _deprecated_function( __FUNCTION__, '14.0.0' ); 48 49 // Default to true. 50 $use_admin_bar = true; 51 52 if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) { 53 _doing_it_wrong( 'BP_USE_WP_ADMIN_BAR', esc_html__( 'The BP_USE_WP_ADMIN_BAR constant is deprecated.', 'buddypress' ), 'BuddyPress 14.0.0' ); 54 } 55 56 /** 57 * Filters whether or not to use the admin bar. 58 * 59 * @since 1.5.0 60 * @deprecated 14.0.0 61 * 62 * @param bool $use_admin_bar Whether or not to use the admin bar. 63 */ 64 return apply_filters_deprecated( 'bp_use_wp_admin_bar', array( $use_admin_bar ), '14.0.0' ); 65 }
Note: See TracChangeset
for help on using the changeset viewer.