wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_print_inline_script_tag › WordPress Function

Od5.7.0
Przestarzałyn/a
wp_print_inline_script_tag ( $data, $attributes = array() )
Parametry: (2)
  • (string) $data Data for script tag: JavaScript, importmap, speculationrules, etc.
    Wymagane: Tak
  • (array) $attributes Optional. Key-value pairs representing `<script>` tag attributes.
    Wymagane: Nie
    Domyślny: array()
Zdefiniowane na:
Codex:

Prints an inline script tag.

It is possible to inject attributes in the <script> tag via the {@see 'wp_script_attributes'} filter. Automatically injects type attribute if needed.


Źródło

function wp_print_inline_script_tag( $data, $attributes = array() ) {
	echo wp_get_inline_script_tag( $data, $attributes );
}