WordPress.org

Plugin Directory

Changeset 711816


Ignore:
Timestamp:
05/12/13 15:31:08 (11 months ago)
Author:
tillkruess
Message:

enqueue open sans only if it's needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mp6/trunk/mp6.php

    r711149 r711816  
    3939         
    4040    $wp_styles->registered[ 'colors' ]->ver = $modtime; 
     41    $wp_styles->registered[ 'colors' ]->deps[] = 'open-sans'; 
    4142} 
    4243 
     
    6162    wp_deregister_style( 'admin-bar' ); 
    6263     
    63     $modtime = filemtime( plugin_dir_path( __FILE__ ) .'css/admin-bar.css' ); 
    64     wp_register_style( 'admin-bar', plugins_url( 'css/admin-bar.css', __FILE__ ), array(), $modtime ); 
     64    $modtime = filemtime( plugin_dir_path( __FILE__ ) . 'css/admin-bar.css' ); 
     65    wp_register_style( 'admin-bar', plugins_url( 'css/admin-bar.css', __FILE__ ), array( 'open-sans' ), $modtime ); 
    6566} 
    6667 
    67 // load Open Sans 
    68 add_action( 'init', 'mp6_load_open_sans' ); 
     68// register Open Sans stylesheet 
     69add_action( 'init', 'mp6_load_open_sans', 9 ); 
    6970function mp6_load_open_sans() { 
    7071    wp_register_style( 'open-sans', '//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=latin-ext,latin', false, 0.1 ); 
    71     wp_enqueue_style( 'open-sans' ); 
    7272} 
    7373 
Note: See TracChangeset for help on using the changeset viewer.