Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_inline_script_attributes

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2425      /**
2426       * Filters attributes to be added to a script tag.
2427       *
2428       * @since 5.7.0
2429       *
2430       * @param array $attributes Key-value pairs representing `<script>` tag attributes.
2431       *                          Only the attribute name is added to the `<script>` tag for
2432       *                          entries with a boolean value, and that are true.
2433       */
2434      $attributes = apply_filters( 'wp_inline_script_attributes', $attributes, $javascript );
2435
2436      $javascript = "\n" . trim( $javascript, "\n\r " ) . "\n";
2437
2438      return sprintf( "<script%s>%s</script>\n", wp_sanitize_script_attributes( $attributes ), $javascript );
2439 }
2440
2441 /**
2442  * Prints inline JavaScript wrapped in `<script>` tag.
2443  *