+ * @param string $handle Name of the script. Should be unique.
+ * @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
+ * @param array $deps Optional. An array of registered script handles this script depends on. Default empty array.
+ * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
+ * as a query string for cache busting purposes. If version is set to false, a version
+ * number is automatically added equal to current installed WordPress version.
+ * If set to null, no version is added.
+ * @param bool $in_footer Optional. Whether to enqueue the script before </body> instead of in the <head>.
+ * Default 'false'.
+ * @return bool Whether the script has been registered. True on success, false on failure.
+ */
+function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
+ $wp_scripts = wp_scripts();
+ _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
+
+ $registered = $wp_scripts->add( $handle, $src, $deps, $ver );
+ if ( $in_footer ) {
+ $wp_scripts->add_data( $handle, 'group', 1 );
+ }
+
+ return $registered;
+}
+
+/**
+ * Localize a script.
+ *
+ * Works only if the script has already been added.
+ *
+ * Accepts an associative array $l10n and creates a JavaScript object:
+ *
+ * "$object_name" = {
+ * key: value,
+ * key: value,
+ * ...
+ * }
+ *
+ *
+ * @see WP_Dependencies::localize()
+ * @link https://core.trac.wordpress.org/ticket/11520
+ * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
+ *
+ * @since 2.2.0
+ *
+ * @todo Documentation cleanup
+ *
+ * @param string $handle Script handle the data will be attached to.
+ * @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.
+ * Example: '/[a-zA-Z0-9_]+/'.
+ * @param array $l10n The data itself. The data can be either a single or multi-dimensional array.
+ * @return bool True if the script was successfully localized, false otherwise.