Make WordPress Core


Ignore:
Timestamp:
02/23/2016 04:43:41 PM (9 years ago)
Author:
swissspidy
Message:

Script Loader: Introduce wp_add_inline_script().

This new function can be used to add inline JavaScript before and after enqueued scripts, just like wp_add_inline_style() works for CSS.

Props atimmer, abiralneupane, ocean90, swissspidy.
Fixes #14853.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r36591 r36633  
    993993        }
    994994
     995        if ( ! empty( $wp_scripts->print_html_before ) ) {
     996            echo $wp_scripts->print_html_before;
     997        }
     998
    995999        $concat = str_split( $concat, 128 );
    9961000        $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
Note: See TracChangeset for help on using the changeset viewer.