Changeset 48295 for trunk/src/wp-includes/class.wp-scripts.php
- Timestamp:
- 07/04/2020 04:52:49 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class.wp-scripts.php
r47219 r48295 228 228 } 229 229 230 echo "<script{$this->type_attr}>\n";230 printf( "<script%s id='%s-js-extra'>\n", $this->type_attr, esc_attr( $handle ) ); 231 231 232 232 // CDATA is not needed for HTML 5. … … 299 299 300 300 if ( $before_handle ) { 301 $before_handle = sprintf( "<script%s >\n%s\n</script>\n", $this->type_attr, $before_handle );301 $before_handle = sprintf( "<script%s id='%s-js-before'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $before_handle ); 302 302 } 303 303 304 304 if ( $after_handle ) { 305 $after_handle = sprintf( "<script%s >\n%s\n</script>\n", $this->type_attr, $after_handle );305 $after_handle = sprintf( "<script%s id='%s-js-after'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $after_handle ); 306 306 } 307 307 … … 367 367 $translations = $this->print_translations( $handle, false ); 368 368 if ( $translations ) { 369 $translations = sprintf( "<script%s >\n%s\n</script>\n", $this->type_attr, $translations );369 $translations = sprintf( "<script%s id='%s-js-translations'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $translations ); 370 370 } 371 371 … … 386 386 387 387 $tag = $translations . $cond_before . $before_handle; 388 $tag .= sprintf( "<script%s src='%s' ></script>\n", $this->type_attr, $src);388 $tag .= sprintf( "<script%s src='%s' id='%s-js'></script>\n", $this->type_attr, $src, esc_attr( $handle ) ); 389 389 $tag .= $after_handle . $cond_after; 390 390 … … 459 459 460 460 if ( $echo ) { 461 printf( "<script%s >\n%s\n</script>\n", $this->type_attr, $output );461 printf( "<script%s id='%s-js-%s'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), esc_attr( $position ), $output ); 462 462 } 463 463 … … 596 596 597 597 if ( $echo ) { 598 printf( "<script%s >\n%s\n</script>\n", $this->type_attr, $output );598 printf( "<script%s id='%s-js-translations'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $output ); 599 599 } 600 600
Note: See TracChangeset
for help on using the changeset viewer.