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