Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/12/2009 07:06:09 PM (17 years ago)
Author:
apeatling
Message:

Moving admin bar CSS enqueue into its own function so that it can be removed easily.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-cssjs.php

    r1052 r1076  
    4141 */
    4242function bp_core_add_css() {
    43     if ( is_user_logged_in() || ( (int)get_site_option( 'show-loggedout-adminbar' ) && !is_user_logged_in() ) ) {
    44         wp_enqueue_style( 'bp-admin-bar', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar.css' ) );
    45        
    46         if ( 'rtl' == get_bloginfo('text_direction') && file_exists( ABSPATH . MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) )
    47             wp_enqueue_style( 'bp-admin-bar-rtl', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) );
    48     }
    49    
    5043    // Enable a sitewide CSS file that will apply styles to both the home blog theme
    5144    // and the member theme.
     
    5649}
    5750add_action( 'wp_head', 'bp_core_add_css' );
     51
     52/**
     53 * bp_core_admin_bar_css()
     54 *
     55 * Add the CSS required for the global admin bar.
     56 *
     57 * @package BuddyPress Core
     58 */
     59function bp_core_admin_bar_css() {
     60    if ( is_user_logged_in() || ( (int)get_site_option( 'show-loggedout-adminbar' ) && !is_user_logged_in() ) ) {
     61        wp_enqueue_style( 'bp-admin-bar', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar.css' ) );
     62       
     63        if ( 'rtl' == get_bloginfo('text_direction') && file_exists( ABSPATH . MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) )
     64            wp_enqueue_style( 'bp-admin-bar-rtl', site_url( MUPLUGINDIR . '/bp-core/css/admin-bar-rtl.css' ) );
     65    }
     66}
     67add_action( 'wp_head', 'bp_core_admin_bar_css' );
    5868
    5969/**
Note: See TracChangeset for help on using the changeset viewer.