Changeset 27203
- Timestamp:
- 02/20/2014 06:58:10 AM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-styles.php
r27111 r27203 63 63 64 64 $href = $this->_css_href( $obj->src, $ver, $handle ); 65 if ( empty( $href ) ) {66 // Turns out there is nothing to print.67 return true;68 }69 65 $rel = isset($obj->extra['alt']) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet'; 70 66 $title = isset($obj->extra['title']) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : ''; -
trunk/src/wp-includes/deprecated.php
r26933 r27203 3414 3414 } 3415 3415 3416 /** 3417 * Callback formerly fired on the style_loader_src hook. No longer needed. 3418 * 3419 * @since 2.6.0 3420 * @deprecated 3.9.0 3421 */ 3422 function wp_style_loader_src() {} -
trunk/src/wp-includes/script-loader.php
r27199 r27203 577 577 } 578 578 579 // Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string. 580 $styles->add( 'colors', true, array( 'wp-admin', 'buttons', 'open-sans', 'dashicons' ) ); 581 582 // do not refer to this directly, the right one is queued by the above "meta" colors handle 583 $styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); 579 // Register a stylesheet for the selected admin color scheme. 580 $colors_url = false; 581 if ( ! empty( $GLOBALS['_wp_admin_css_colors'] ) ) { 582 $color = get_user_option( 'admin_color' ); 583 if ( ! $color || ! isset( $GLOBALS['_wp_admin_css_colors'][ $color ] ) ) { 584 $color = 'fresh'; 585 } 586 $colors_url = $GLOBALS['_wp_admin_css_colors'][ $color ]->url; 587 } 588 $styles->add( 'colors', $colors_url, array( 'wp-admin', 'buttons', 'open-sans', 'dashicons' ) ); 584 589 585 590 $suffix = SCRIPT_DEBUG ? '' : '.min'; … … 602 607 // Includes CSS 603 608 $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array( 'open-sans', 'dashicons' ) ); 604 $styles->add( 'wp-auth-check', "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );609 $styles->add( 'wp-auth-check', "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons', 'colors' ) ); 605 610 $styles->add( 'editor-buttons', "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) ); 606 611 $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons' ) ); … … 618 623 $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' ); 619 624 $styles->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.css", array(), '0.9.12' ); 625 $styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle. 620 626 621 627 // RTL CSS … … 680 686 681 687 /** 682 * Administration Screen CSS for changing the styles.683 *684 * If installing the 'wp-admin/' directory will be replaced with './'.685 *686 * The $_wp_admin_css_colors global manages the Administration Screens CSS687 * stylesheet that is loaded. The option that is set is 'admin_color' and is the688 * color and key for the array. The value for the color key is an object with689 * a 'url' parameter that has the URL path to the CSS file.690 *691 * The query from $src parameter will be appended to the URL that is given from692 * the $_wp_admin_css_colors array value URL.693 *694 * @since 2.6.0695 * @uses $_wp_admin_css_colors696 *697 * @param string $src Source URL.698 * @param string $handle Either 'colors' or 'colors-rtl'.699 * @return string URL path to CSS stylesheet for Administration Screens.700 */701 function wp_style_loader_src( $src, $handle ) {702 if ( defined('WP_INSTALLING') )703 return preg_replace( '#^wp-admin/#', './', $src );704 705 if ( 'colors' == $handle || 'colors-rtl' == $handle ) {706 global $_wp_admin_css_colors;707 $color = get_user_option('admin_color');708 709 if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )710 $color = 'fresh';711 712 $color = $_wp_admin_css_colors[$color];713 $parsed = parse_url( $src );714 $url = $color->url;715 716 if ( ! $url ) {717 return false;718 }719 720 if ( isset($parsed['query']) && $parsed['query'] ) {721 wp_parse_str( $parsed['query'], $qv );722 $url = add_query_arg( $qv, $url );723 }724 725 return $url;726 }727 728 return $src;729 }730 731 /**732 688 * Prints the script queue in the HTML head on admin pages. 733 689 * … … 975 931 976 932 add_action( 'wp_default_styles', 'wp_default_styles' ); 977 add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );
Note: See TracChangeset
for help on using the changeset viewer.