Changeset 18446
- Timestamp:
- 07/21/2011 04:32:01 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class.wp-dependencies.php
r17771 r18446 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. -
trunk/wp-includes/class.wp-scripts.php
r16469 r18446 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 } -
trunk/wp-includes/class.wp-styles.php
r13351 r18446 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 -
trunk/wp-includes/default-filters.php
r17999 r18446 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 ); -
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.