Changeset 8764 for trunk/src/bp-core/bp-core-adminbar.php
- Timestamp:
- 08/07/2014 02:11:24 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-adminbar.php
r8568 r8764 91 91 92 92 /** 93 * Handle the Toolbar CSS. 93 * Handle the enqueuing of toolbar CSS. 94 * 95 * This function exists mostly for backwards compatibility reasons, so anyone 96 * previously unhooking this function can continue to do so. It's hooked to 97 * the `bp_init` action in `bp-core-actions.php`. 94 98 * 95 99 * @since BuddyPress (1.5.0) 96 100 */ 97 101 function bp_core_load_admin_bar_css() { 98 global $wp_styles; 102 add_action( 'bp_enqueue_scripts', 'bp_core_enqueue_admin_bar_css', 1 ); 103 add_action( 'bp_admin_enqueue_scripts', 'bp_core_enqueue_admin_bar_css', 1 ); 104 } 99 105 100 if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() ) 106 /** 107 * Enqueue supplemental WordPress Toolbar styling 108 * 109 * @since BuddyPress (2.1.0) 110 * 111 * @see bp_core_register_common_styles() 112 * @see bp_core_load_admin_bar_css() 113 */ 114 function bp_core_enqueue_admin_bar_css() { 115 116 // Bail if not using WordPress's admin bar or it's not showing on this 117 // page request. 118 if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() ) { 101 119 return; 120 } 102 121 103 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 104 105 // Toolbar styles 106 $stylesheet = buddypress()->plugin_url . "bp-core/css/admin-bar{$min}.css"; 107 108 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), bp_get_version() ); 109 $wp_styles->add_data( 'bp-admin-bar', 'rtl', true ); 110 if ( $min ) 111 $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min ); 122 // Enqueue the additional adminbar css 123 wp_enqueue_style( 'bp-admin-bar' ); 112 124 }
Note: See TracChangeset
for help on using the changeset viewer.