Ticket #9346: 9346-2.patch
File 9346-2.patch, 5.2 KB (added by , 13 years ago) |
---|
-
wp-includes/class.wp-dependencies.php
39 39 $this->all_deps( $handles ); 40 40 41 41 foreach( $this->to_do as $key => $handle ) { 42 if ( !in_array($handle, $this->done ) && isset($this->registered[$handle]) ) {42 if ( !in_array($handle, $this->done, true) && isset($this->registered[$handle]) ) { 43 43 44 44 if ( ! $this->registered[$handle]->src ) { // Defines a group. 45 45 $this->done[] = $handle; -
wp-includes/class.wp-scripts.php
167 167 } 168 168 169 169 function do_footer_items() { 170 if ( !empty($this->in_footer) ) { 171 foreach( $this->in_footer as $key => $handle ) { 172 if ( !in_array($handle, $this->done, true) && isset($this->registered[$handle]) ) { 173 $this->do_item($handle); 174 $this->done[] = $handle; 175 unset( $this->in_footer[$key] ); 176 } 177 } 178 } 170 $this->do_items(false, 1); 179 171 return $this->done; 180 172 } 181 173 -
wp-includes/class.wp-styles.php
122 122 } 123 123 return false; 124 124 } 125 126 function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer. 127 $this->do_items(false, 1); 128 return $this->done; 129 } 125 130 131 function reset() { 132 $this->do_concat = false; 133 $this->concat = ''; 134 $this->concat_version = ''; 135 $this->print_html = ''; 136 } 126 137 } 138 -
wp-includes/default-filters.php
242 242 add_action( 'do_robots', 'do_robots' ); 243 243 add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' ); 244 244 add_action( 'admin_print_scripts', 'print_head_scripts', 20 ); 245 add_action( 'admin_print_footer_scripts', ' print_footer_scripts',20 );245 add_action( 'admin_print_footer_scripts', 'wp_print_footer_scripts', 20 ); 246 246 add_action( 'admin_print_styles', 'print_admin_styles', 20 ); 247 247 add_action( 'init', 'smilies_init', 5 ); 248 248 add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); -
wp-includes/script-loader.php
474 474 $styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : ''; 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' : ''; 480 480 … … 723 723 * @since 2.8 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 729 731 /** … … 752 754 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 } 757 if ( apply_filters('print_admin_styles', true) ) 758 _print_styles(); 762 759 763 if ( !empty($wp_styles->print_html) )764 echo $wp_styles->print_html;765 760 $wp_styles->reset(); 761 return $wp_styles->done; 762 } 766 763 767 $wp_styles->do_concat = false; 768 $wp_styles->concat = $wp_styles->concat_version = $wp_styles->print_html = ''; 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(); 769 777 return $wp_styles->done; 770 778 } 771 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"; 792 } 793 794 if ( !empty($wp_styles->print_html) ) 795 echo $wp_styles->print_html; 796 } 797 772 798 function script_concat_settings() { 773 799 global $concatenate_scripts, $compress_scripts, $compress_css; 774 800