Changeset 27515
- Timestamp:
- 03/12/2014 04:11:38 PM (12 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
-
class.wp-styles.php (modified) (1 diff)
-
deprecated.php (modified) (1 diff)
-
script-loader.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-styles.php
r27203 r27515 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 } 65 69 $rel = isset($obj->extra['alt']) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet'; 66 70 $title = isset($obj->extra['title']) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : ''; -
trunk/src/wp-includes/deprecated.php
r27424 r27515 3413 3413 3414 3414 /** 3415 * Callback formerly fired on the style_loader_src hook. No longer needed.3416 *3417 * @since 2.6.03418 * @deprecated 3.9.03419 */3420 function wp_style_loader_src() {}3421 3422 3423 /**3424 3415 * Old callback for tag link tooltips. 3425 3416 * -
trunk/src/wp-includes/script-loader.php
r27499 r27515 582 582 583 583 // Register a stylesheet for the selected admin color scheme. 584 $colors_url = false; 585 if ( ! empty( $GLOBALS['_wp_admin_css_colors'] ) ) { 586 $color = get_user_option( 'admin_color' ); 587 if ( ! $color || ! isset( $GLOBALS['_wp_admin_css_colors'][ $color ] ) ) { 588 $color = 'fresh'; 589 } 590 $colors_url = $GLOBALS['_wp_admin_css_colors'][ $color ]->url; 591 } 592 $styles->add( 'colors', $colors_url, array( 'wp-admin', 'buttons', 'open-sans', 'dashicons' ) ); 584 $styles->add( 'colors', true, array( 'wp-admin', 'buttons', 'open-sans', 'dashicons' ) ); 593 585 594 586 $suffix = SCRIPT_DEBUG ? '' : '.min'; … … 690 682 691 683 /** 684 * Administration Screen CSS for changing the styles. 685 * 686 * If installing the 'wp-admin/' directory will be replaced with './'. 687 * 688 * The $_wp_admin_css_colors global manages the Administration Screens CSS 689 * stylesheet that is loaded. The option that is set is 'admin_color' and is the 690 * color and key for the array. The value for the color key is an object with 691 * a 'url' parameter that has the URL path to the CSS file. 692 * 693 * The query from $src parameter will be appended to the URL that is given from 694 * the $_wp_admin_css_colors array value URL. 695 * 696 * @since 2.6.0 697 * @uses $_wp_admin_css_colors 698 * 699 * @param string $src Source URL. 700 * @param string $handle Either 'colors' or 'colors-rtl'. 701 * @return string URL path to CSS stylesheet for Administration Screens. 702 */ 703 function wp_style_loader_src( $src, $handle ) { 704 global $_wp_admin_css_colors; 705 706 if ( defined('WP_INSTALLING') ) 707 return preg_replace( '#^wp-admin/#', './', $src ); 708 709 if ( 'colors' == $handle ) { 710 $color = get_user_option('admin_color'); 711 712 if ( empty($color) || !isset($_wp_admin_css_colors[$color]) ) 713 $color = 'fresh'; 714 715 $color = $_wp_admin_css_colors[$color]; 716 $parsed = parse_url( $src ); 717 $url = $color->url; 718 719 if ( ! $url ) { 720 return false; 721 } 722 723 if ( isset($parsed['query']) && $parsed['query'] ) { 724 wp_parse_str( $parsed['query'], $qv ); 725 $url = add_query_arg( $qv, $url ); 726 } 727 728 return $url; 729 } 730 731 return $src; 732 } 733 734 /** 692 735 * Prints the script queue in the HTML head on admin pages. 693 736 * … … 935 978 936 979 add_action( 'wp_default_styles', 'wp_default_styles' ); 980 add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );
Note: See TracChangeset
for help on using the changeset viewer.