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



wp_inline_script_attributes › Filtr WordPress Hooks

Od5.7.0
Przestarzałyn/a
› apply_filters( 'wp_inline_script_attributes', $attributes, $data )
Parametry: (2)
  • () attributes Key-value pairs representing `<script>` tag attributes. Only the attribute name is added to the `<script>` tag for entries with a boolean value, and that are true.
    Wymagane: Tak
  • () data Inline data.
    Wymagane: Tak
Zdefiniowane na:
Codex:

Filters attributes to be added to a script tag.

Escaping and normalization can make the text a browser parses from the printed tag differ from `$data`. A callback that needs that text, such as one computing a CSP hash, can set `$data` as the modifiable text of a SCRIPT tag in a `WP_HTML_Tag_Processor` with the filtered attributes applied and then read {@see \WP_HTML_Tag_Processor::get_modifiable_text()}, at a late priority so that the attributes are final.




Źródło

$attributes = apply_filters( 'wp_inline_script_attributes', $attributes, $data );