Changeset 2209 for trunk/bp-core/bp-core-cssjs.php
- Timestamp:
- 12/27/2009 10:41:10 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-cssjs.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-cssjs.php
r2206 r2209 10 10 */ 11 11 function bp_core_add_admin_bar_css() { 12 global $ current_blog;12 global $bp; 13 13 14 14 if ( defined( 'BP_DISABLE_ADMIN_BAR' ) ) 15 15 return false; 16 16 17 /* Fetch the admin bar css from the active theme location */ 18 if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) . '/_inc/css/adminbar.css' ) ) 19 $admin_bar_css = WP_CONTENT_URL . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) . '/_inc/css/adminbar.css'; 20 else if ( file_exists( WP_CONTENT_DIR . '/' . get_blog_option( BP_ROOT_BLOG, 'template' ) . '/_inc/css/adminbar.css' ) ) 21 $admin_bar_css = WP_CONTENT_URL . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template' ) . '/_inc/css/adminbar.css'; 22 else 23 $admin_bar_css = BP_PLUGIN_URL . '/bp-core/css/admin-bar-fallback.css'; 24 25 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $admin_bar_css ) ); 17 /* Check there is admin bar css in the currently active theme. If not fallback to the css in the plugin. */ 18 if ( !locate_template( array( '_inc/css/adminbar.css' ), false ) ) 19 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', BP_PLUGIN_URL . '/bp-core/css/admin-bar-fallback.css' ) ); 20 else { 21 if ( is_admin() ) 22 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', str_replace( ABSPATH, $bp->root_domain . '/', locate_template( array( '_inc/css/adminbar.css' ), false ) ) ) ); 23 } 26 24 } 27 add_action( 'admin_menu', 'bp_core_add_admin_bar_css' ); 28 add_action( 'template_redirect', 'bp_core_add_admin_bar_css' ); 25 add_action( 'init', 'bp_core_add_admin_bar_css' ); 29 26 30 27 /** … … 39 36 wp_enqueue_script( 'bp-admin-bar-js', BP_PLUGIN_URL . '/bp-core/js/admin-bar.js', array( 'jquery' ) ); 40 37 } 41 add_action( 'admin_menu', 'bp_core_add_admin_bar_js' ); 42 add_action( 'wp', 'bp_core_add_admin_bar_js' ); 38 add_action( 'init', 'bp_core_add_admin_bar_js' ); 43 39 44 40 /**
Note: See TracChangeset
for help on using the changeset viewer.