Ticket #14853: class.wp-scripts.php.patch
| File class.wp-scripts.php.patch, 1.0 KB (added by , 11 years ago) |
|---|
-
class.wp-scripts.php
83 83 * @return bool|string|void 84 84 */ 85 85 public function print_extra_script( $handle, $echo = true ) { 86 $scripts = $this->get_data( $handle, 'after' ); 87 if($scripts){ 88 foreach($scripts as $script){ 89 echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5 90 echo "$script\n"; 91 echo "</script>\n"; 92 } 93 } 94 86 95 if ( !$output = $this->get_data( $handle, 'data' ) ) 87 96 return; 88 97 … … 203 212 return true; 204 213 } 205 214 215 public function add_inline_script( $handle, $code ) { 216 if ( ! $code ) { 217 return false; 218 } 219 220 $after = $this->get_data( $handle, 'after' ); 221 if ( ! $after ) { 222 $after = array(); 223 } 224 225 $after[] = $code; 226 227 return $this->add_data( $handle, 'after', $after ); 228 } 229 206 230 /** 207 231 * Localizes a script, only if the script has already been added 208 232 *
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)