Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function lxb_toolbar_styles() {
- // If you're not logged in, you don't get the toolbar, nor do you need it's styles.
- if( ! is_user_logged_in() ) { return FALSE; }
- // Get the current admin color scheme, so we can load the right styles
- $color_scheme = get_user_option( 'admin_color' );
- // Check and see if we have a corresponding toolbar stylesheet for the current theme
- $themes_path = plugin_dir_path( __FILE__ ). 'themes/';
- $themes = glob( $themes_path . '*.css' );
- $current_theme_path = plugin_dir_path( __FILE__ ). "themes/toolbar-$color_scheme.css";
- // If we don't, just load the default
- if( !in_array( $current_theme_path, $themes ) ){
- $color_scheme = 'lexblog_default';
- }
- $url = esc_url( plugins_url ( "themes/toolbar-$color_scheme.css", __FILE__ ) );
- wp_register_style( 'lxb-toolbar', $url );
- wp_enqueue_style( 'lxb-toolbar' );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement