Changeset 18446 for trunk/wp-includes/script-loader.php
- Timestamp:
- 07/21/2011 04:32:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/script-loader.php
r18436 r18446 475 475 $styles->default_version = get_bloginfo( 'version' ); 476 476 $styles->text_direction = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr'; 477 $styles->default_dirs = array('/wp-admin/' );477 $styles->default_dirs = array('/wp-admin/', '/wp-includes/'); 478 478 479 479 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : ''; … … 724 724 */ 725 725 function wp_print_footer_scripts() { 726 return print_footer_scripts(); 726 print_late_styles(); 727 print_footer_scripts(); 728 return true; 727 729 } 728 730 … … 753 755 $wp_styles->do_items(false); 754 756 755 if ( apply_filters('print_admin_styles', true) ) { 756 if ( !empty($wp_styles->concat) ) { 757 $dir = $wp_styles->text_direction; 758 $ver = md5("$wp_styles->concat_version{$dir}"); 759 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=" . trim($wp_styles->concat, ', ') . "&ver=$ver"; 760 echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n"; 761 } 762 763 if ( !empty($wp_styles->print_html) ) 764 echo $wp_styles->print_html; 757 if ( apply_filters('print_admin_styles', true) ) 758 _print_styles(); 759 760 $wp_styles->reset(); 761 return $wp_styles->done; 762 } 763 764 function print_late_styles() { 765 global $wp_styles, $concatenate_scripts; 766 767 if ( !is_a($wp_styles, 'WP_Styles') ) 768 return; 769 770 $wp_styles->do_concat = $concatenate_scripts; 771 $wp_styles->do_footer_items(); 772 773 if ( apply_filters('print_late_styles', true) ) 774 _print_styles(); 775 776 $wp_styles->reset(); 777 return $wp_styles->done; 778 } 779 780 function _print_styles() { 781 global $wp_styles, $compress_css; 782 783 $zip = $compress_css ? 1 : 0; 784 if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) 785 $zip = 'gzip'; 786 787 if ( !empty($wp_styles->concat) ) { 788 $dir = $wp_styles->text_direction; 789 $ver = md5("$wp_styles->concat_version{$dir}"); 790 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=" . trim($wp_styles->concat, ', ') . "&ver=$ver"; 791 echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n"; 765 792 } 766 793 767 $wp_styles->do_concat = false; 768 $wp_styles->concat = $wp_styles->concat_version = $wp_styles->print_html = ''; 769 return $wp_styles->done; 794 if ( !empty($wp_styles->print_html) ) 795 echo $wp_styles->print_html; 770 796 } 771 797
Note: See TracChangeset
for help on using the changeset viewer.