Remove wp_add_script_before() from 3.3. Continue to use wp_localize_script() for your data-passing needs. fixes #11520.

git-svn-id: https://develop.svn.wordpress.org/trunk@19573 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2011-12-08 20:46:58 +00:00
parent 6b3d8e9fc8
commit 248eba8b48
2 changed files with 0 additions and 37 deletions
-21
View File
@@ -96,27 +96,6 @@ function wp_localize_script( $handle, $object_name, $l10n ) {
return $wp_scripts->localize( $handle, $object_name, $l10n );
}
/**
* Adds extra Javascript.
*
* Works only if the script referenced by $handle has already been added.
* Accepts string $script that will be printed before the main script tag.
*
* @since 3.3
* @see WP_Scripts::add_script_data()
*/
function wp_add_script_before( $handle, $script ) {
global $wp_scripts;
if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
if ( ! did_action( 'init' ) )
_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
return false;
}
return $wp_scripts->add_script_data( $handle, $script );
}
/**
* Remove a registered script.
*