Ticket #50999: 50999.diff
| File 50999.diff, 1.8 KB (added by , 6 years ago) |
|---|
-
src/wp-includes/class.wp-scripts.php
296 296 297 297 $before_handle = $this->print_inline_script( $handle, 'before', false ); 298 298 $after_handle = $this->print_inline_script( $handle, 'after', false ); 299 $translations = $this->print_translations( $handle, false ); 299 300 300 301 if ( $before_handle ) { 301 302 $before_handle = sprintf( "<script%s id='%s-js-before'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $before_handle ); … … 305 306 $after_handle = sprintf( "<script%s id='%s-js-after'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $after_handle ); 306 307 } 307 308 309 if ( $translations ) { 310 $translations = sprintf( "<script%s id='%s-js-translations'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $translations ); 311 } 312 308 313 if ( $before_handle || $after_handle ) { 309 314 $inline_script_tag = $cond_before . $before_handle . $after_handle . $cond_after; 310 315 } else { … … 330 335 $this->reset(); 331 336 } elseif ( $this->in_default_dir( $srce ) && ! $conditional ) { 332 337 $this->print_code .= $this->print_extra_script( $handle, false ); 338 $this->print_code .= $translations; 333 339 $this->concat .= "$handle,"; 334 340 $this->concat_version .= "$handle$ver"; 335 341 return true; … … 364 370 return true; 365 371 } 366 372 367 $translations = $this->print_translations( $handle, false );368 373 if ( $translations ) { 369 $translations = sprintf( "<script%s id='%s-js-translations'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $translations );374 echo $translations; 370 375 } 371 376 372 377 if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {