Changeset 31189
- Timestamp:
- 01/16/2015 01:10:39 AM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-scripts.php
r31033 r31189 28 28 public $print_code = ''; 29 29 public $ext_handles = ''; 30 public $print_after_html = '';31 30 public $ext_version = ''; 32 31 public $default_dirs; … … 69 68 } 70 69 71 public function print_extra_script( $handle, $echo = true , $key = 'data') {72 if ( ! $output = $this->get_data( $handle, $key ) ) {70 public function print_extra_script( $handle, $echo = true ) { 71 if ( !$output = $this->get_data( $handle, 'data' ) ) 73 72 return; 74 } 75 76 if ( ! $echo ) { 73 74 if ( !$echo ) 77 75 return $output; 78 }79 76 80 77 echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5 … … 121 118 if ( $this->in_default_dir($srce) ) { 122 119 $this->print_code .= $this->print_extra_script( $handle, false ); 123 $this->print_after_html .= "\n" . $this->print_extra_script( $handle, false, 'data-after' );124 120 $this->concat .= "$handle,"; 125 121 $this->concat_version .= "$handle$ver"; … … 160 156 if ( $this->do_concat ) { 161 157 $this->print_html .= $tag; 162 $this->print_after_html .= $this->print_extra_script( $handle, false, 'data-after' ) . "\n";163 158 } else { 164 159 echo $tag; 165 $this->print_extra_script( $handle, true, 'data-after' );166 160 } 167 161 … … 268 262 $this->concat_version = ''; 269 263 $this->print_html = ''; 270 $this->print_after_html = '';271 264 $this->ext_version = ''; 272 265 $this->ext_handles = ''; -
trunk/src/wp-includes/script-loader.php
r31188 r31189 861 861 } 862 862 863 if ( ! empty( $wp_scripts->print_html ) ) {863 if ( !empty($wp_scripts->print_html) ) 864 864 echo $wp_scripts->print_html; 865 }866 867 if ( ! empty( $wp_scripts->print_after_html ) ) {868 if ( $wp_scripts->do_concat ) {869 echo "<script type='text/javascript'>\n";870 echo "/* <![CDATA[ */\n"; // not needed in HTML 5871 echo trim( $wp_scripts->print_after_html ) . "\n";872 echo "/* ]]> */\n";873 echo "</script>\n";874 } else {875 echo $wp_scripts->print_after_html;876 }877 }878 865 } 879 866
Note: See TracChangeset
for help on using the changeset viewer.