Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: functions.wp-scripts.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Dependencies API: Scripts functions
[2] Fix | Delete
*
[3] Fix | Delete
* @since 2.6.0
[4] Fix | Delete
*
[5] Fix | Delete
* @package WordPress
[6] Fix | Delete
* @subpackage Dependencies
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Initializes $wp_scripts if it has not been set.
[11] Fix | Delete
*
[12] Fix | Delete
* @since 4.2.0
[13] Fix | Delete
*
[14] Fix | Delete
* @global WP_Scripts $wp_scripts
[15] Fix | Delete
*
[16] Fix | Delete
* @return WP_Scripts WP_Scripts instance.
[17] Fix | Delete
*/
[18] Fix | Delete
function wp_scripts() {
[19] Fix | Delete
global $wp_scripts;
[20] Fix | Delete
[21] Fix | Delete
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
[22] Fix | Delete
$wp_scripts = new WP_Scripts();
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
return $wp_scripts;
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Helper function to output a _doing_it_wrong message when applicable.
[30] Fix | Delete
*
[31] Fix | Delete
* @ignore
[32] Fix | Delete
* @since 4.2.0
[33] Fix | Delete
* @since 5.5.0 Added the `$handle` parameter.
[34] Fix | Delete
*
[35] Fix | Delete
* @param string $function_name Function name.
[36] Fix | Delete
* @param string $handle Optional. Name of the script or stylesheet that was
[37] Fix | Delete
* registered or enqueued too early. Default empty.
[38] Fix | Delete
*/
[39] Fix | Delete
function _wp_scripts_maybe_doing_it_wrong( $function_name, $handle = '' ) {
[40] Fix | Delete
if ( did_action( 'init' ) || did_action( 'wp_enqueue_scripts' )
[41] Fix | Delete
|| did_action( 'admin_enqueue_scripts' ) || did_action( 'login_enqueue_scripts' )
[42] Fix | Delete
) {
[43] Fix | Delete
return;
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
$message = sprintf(
[47] Fix | Delete
/* translators: 1: wp_enqueue_scripts, 2: admin_enqueue_scripts, 3: login_enqueue_scripts */
[48] Fix | Delete
__( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
[49] Fix | Delete
'<code>wp_enqueue_scripts</code>',
[50] Fix | Delete
'<code>admin_enqueue_scripts</code>',
[51] Fix | Delete
'<code>login_enqueue_scripts</code>'
[52] Fix | Delete
);
[53] Fix | Delete
[54] Fix | Delete
if ( $handle ) {
[55] Fix | Delete
$message .= ' ' . sprintf(
[56] Fix | Delete
/* translators: %s: Name of the script or stylesheet. */
[57] Fix | Delete
__( 'This notice was triggered by the %s handle.' ),
[58] Fix | Delete
'<code>' . $handle . '</code>'
[59] Fix | Delete
);
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
_doing_it_wrong(
[63] Fix | Delete
$function_name,
[64] Fix | Delete
$message,
[65] Fix | Delete
'3.3.0'
[66] Fix | Delete
);
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* Prints scripts in document head that are in the $handles queue.
[71] Fix | Delete
*
[72] Fix | Delete
* Called by admin-header.php and {@see 'wp_head'} hook. Since it is called by wp_head on every page load,
[73] Fix | Delete
* the function does not instantiate the WP_Scripts object unless script names are explicitly passed.
[74] Fix | Delete
* Makes use of already-instantiated `$wp_scripts` global if present. Use provided {@see 'wp_print_scripts'}
[75] Fix | Delete
* hook to register/enqueue new scripts.
[76] Fix | Delete
*
[77] Fix | Delete
* @see WP_Scripts::do_item()
[78] Fix | Delete
* @since 2.1.0
[79] Fix | Delete
*
[80] Fix | Delete
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
[81] Fix | Delete
*
[82] Fix | Delete
* @param string|string[]|false $handles Optional. Scripts to be printed. Default 'false'.
[83] Fix | Delete
* @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.
[84] Fix | Delete
*/
[85] Fix | Delete
function wp_print_scripts( $handles = false ) {
[86] Fix | Delete
global $wp_scripts;
[87] Fix | Delete
[88] Fix | Delete
/**
[89] Fix | Delete
* Fires before scripts in the $handles queue are printed.
[90] Fix | Delete
*
[91] Fix | Delete
* @since 2.1.0
[92] Fix | Delete
*/
[93] Fix | Delete
do_action( 'wp_print_scripts' );
[94] Fix | Delete
[95] Fix | Delete
if ( '' === $handles ) { // For 'wp_head'.
[96] Fix | Delete
$handles = false;
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
[100] Fix | Delete
[101] Fix | Delete
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
[102] Fix | Delete
if ( ! $handles ) {
[103] Fix | Delete
return array(); // No need to instantiate if nothing is there.
[104] Fix | Delete
}
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
return wp_scripts()->do_items( $handles );
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
/**
[111] Fix | Delete
* Adds extra code to a registered script.
[112] Fix | Delete
*
[113] Fix | Delete
* Code will only be added if the script is already in the queue.
[114] Fix | Delete
* Accepts a string `$data` containing the code. If two or more code blocks
[115] Fix | Delete
* are added to the same script `$handle`, they will be printed in the order
[116] Fix | Delete
* they were added, i.e. the latter added code can redeclare the previous.
[117] Fix | Delete
*
[118] Fix | Delete
* @since 4.5.0
[119] Fix | Delete
*
[120] Fix | Delete
* @see WP_Scripts::add_inline_script()
[121] Fix | Delete
*
[122] Fix | Delete
* @param string $handle Name of the script to add the inline script to.
[123] Fix | Delete
* @param string $data String containing the JavaScript to be added.
[124] Fix | Delete
* @param string $position Optional. Whether to add the inline script before the handle
[125] Fix | Delete
* or after. Default 'after'.
[126] Fix | Delete
* @return bool True on success, false on failure.
[127] Fix | Delete
*/
[128] Fix | Delete
function wp_add_inline_script( $handle, $data, $position = 'after' ) {
[129] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
[130] Fix | Delete
[131] Fix | Delete
if ( false !== stripos( $data, '</script>' ) ) {
[132] Fix | Delete
_doing_it_wrong(
[133] Fix | Delete
__FUNCTION__,
[134] Fix | Delete
sprintf(
[135] Fix | Delete
/* translators: 1: <script>, 2: wp_add_inline_script() */
[136] Fix | Delete
__( 'Do not pass %1$s tags to %2$s.' ),
[137] Fix | Delete
'<code>&lt;script&gt;</code>',
[138] Fix | Delete
'<code>wp_add_inline_script()</code>'
[139] Fix | Delete
),
[140] Fix | Delete
'4.5.0'
[141] Fix | Delete
);
[142] Fix | Delete
$data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
return wp_scripts()->add_inline_script( $handle, $data, $position );
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
/**
[149] Fix | Delete
* Registers a new script.
[150] Fix | Delete
*
[151] Fix | Delete
* Registers a script to be enqueued later using the wp_enqueue_script() function.
[152] Fix | Delete
*
[153] Fix | Delete
* @see WP_Dependencies::add()
[154] Fix | Delete
* @see WP_Dependencies::add_data()
[155] Fix | Delete
*
[156] Fix | Delete
* @since 2.1.0
[157] Fix | Delete
* @since 4.3.0 A return value was added.
[158] Fix | Delete
* @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array.
[159] Fix | Delete
*
[160] Fix | Delete
* @param string $handle Name of the script. Should be unique.
[161] Fix | Delete
* @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory.
[162] Fix | Delete
* If source is set to false, script is an alias of other scripts it depends on.
[163] Fix | Delete
* @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
[164] Fix | Delete
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
[165] Fix | Delete
* as a query string for cache busting purposes. If version is set to false, a version
[166] Fix | Delete
* number is automatically added equal to current installed WordPress version.
[167] Fix | Delete
* If set to null, no version is added.
[168] Fix | Delete
* @param array|bool $args {
[169] Fix | Delete
* Optional. An array of additional script loading strategies. Default empty array.
[170] Fix | Delete
* Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false.
[171] Fix | Delete
*
[172] Fix | Delete
* @type string $strategy Optional. If provided, may be either 'defer' or 'async'.
[173] Fix | Delete
* @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'.
[174] Fix | Delete
* }
[175] Fix | Delete
* @return bool Whether the script has been registered. True on success, false on failure.
[176] Fix | Delete
*/
[177] Fix | Delete
function wp_register_script( $handle, $src, $deps = array(), $ver = false, $args = array() ) {
[178] Fix | Delete
if ( ! is_array( $args ) ) {
[179] Fix | Delete
$args = array(
[180] Fix | Delete
'in_footer' => (bool) $args,
[181] Fix | Delete
);
[182] Fix | Delete
}
[183] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
[184] Fix | Delete
[185] Fix | Delete
$wp_scripts = wp_scripts();
[186] Fix | Delete
[187] Fix | Delete
$registered = $wp_scripts->add( $handle, $src, $deps, $ver );
[188] Fix | Delete
if ( ! empty( $args['in_footer'] ) ) {
[189] Fix | Delete
$wp_scripts->add_data( $handle, 'group', 1 );
[190] Fix | Delete
}
[191] Fix | Delete
if ( ! empty( $args['strategy'] ) ) {
[192] Fix | Delete
$wp_scripts->add_data( $handle, 'strategy', $args['strategy'] );
[193] Fix | Delete
}
[194] Fix | Delete
return $registered;
[195] Fix | Delete
}
[196] Fix | Delete
[197] Fix | Delete
/**
[198] Fix | Delete
* Localizes a script.
[199] Fix | Delete
*
[200] Fix | Delete
* Works only if the script has already been registered.
[201] Fix | Delete
*
[202] Fix | Delete
* Accepts an associative array `$l10n` and creates a JavaScript object:
[203] Fix | Delete
*
[204] Fix | Delete
* "$object_name": {
[205] Fix | Delete
* key: value,
[206] Fix | Delete
* key: value,
[207] Fix | Delete
* ...
[208] Fix | Delete
* }
[209] Fix | Delete
*
[210] Fix | Delete
* @see WP_Scripts::localize()
[211] Fix | Delete
* @link https://core.trac.wordpress.org/ticket/11520
[212] Fix | Delete
*
[213] Fix | Delete
* @since 2.2.0
[214] Fix | Delete
*
[215] Fix | Delete
* @todo Documentation cleanup
[216] Fix | Delete
*
[217] Fix | Delete
* @param string $handle Script handle the data will be attached to.
[218] Fix | Delete
* @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.
[219] Fix | Delete
* Example: '/[a-zA-Z0-9_]+/'.
[220] Fix | Delete
* @param array $l10n The data itself. The data can be either a single or multi-dimensional array.
[221] Fix | Delete
* @return bool True if the script was successfully localized, false otherwise.
[222] Fix | Delete
*/
[223] Fix | Delete
function wp_localize_script( $handle, $object_name, $l10n ) {
[224] Fix | Delete
$wp_scripts = wp_scripts();
[225] Fix | Delete
[226] Fix | Delete
return $wp_scripts->localize( $handle, $object_name, $l10n );
[227] Fix | Delete
}
[228] Fix | Delete
[229] Fix | Delete
/**
[230] Fix | Delete
* Sets translated strings for a script.
[231] Fix | Delete
*
[232] Fix | Delete
* Works only if the script has already been registered.
[233] Fix | Delete
*
[234] Fix | Delete
* @see WP_Scripts::set_translations()
[235] Fix | Delete
* @since 5.0.0
[236] Fix | Delete
* @since 5.1.0 The `$domain` parameter was made optional.
[237] Fix | Delete
*
[238] Fix | Delete
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
[239] Fix | Delete
*
[240] Fix | Delete
* @param string $handle Script handle the textdomain will be attached to.
[241] Fix | Delete
* @param string $domain Optional. Text domain. Default 'default'.
[242] Fix | Delete
* @param string $path Optional. The full file path to the directory containing translation files.
[243] Fix | Delete
* @return bool True if the text domain was successfully localized, false otherwise.
[244] Fix | Delete
*/
[245] Fix | Delete
function wp_set_script_translations( $handle, $domain = 'default', $path = '' ) {
[246] Fix | Delete
global $wp_scripts;
[247] Fix | Delete
[248] Fix | Delete
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
[249] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
[250] Fix | Delete
return false;
[251] Fix | Delete
}
[252] Fix | Delete
[253] Fix | Delete
return $wp_scripts->set_translations( $handle, $domain, $path );
[254] Fix | Delete
}
[255] Fix | Delete
[256] Fix | Delete
/**
[257] Fix | Delete
* Removes a registered script.
[258] Fix | Delete
*
[259] Fix | Delete
* Note: there are intentional safeguards in place to prevent critical admin scripts,
[260] Fix | Delete
* such as jQuery core, from being unregistered.
[261] Fix | Delete
*
[262] Fix | Delete
* @see WP_Dependencies::remove()
[263] Fix | Delete
*
[264] Fix | Delete
* @since 2.1.0
[265] Fix | Delete
*
[266] Fix | Delete
* @global string $pagenow The filename of the current screen.
[267] Fix | Delete
*
[268] Fix | Delete
* @param string $handle Name of the script to be removed.
[269] Fix | Delete
*/
[270] Fix | Delete
function wp_deregister_script( $handle ) {
[271] Fix | Delete
global $pagenow;
[272] Fix | Delete
[273] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
[274] Fix | Delete
[275] Fix | Delete
/**
[276] Fix | Delete
* Do not allow accidental or negligent de-registering of critical scripts in the admin.
[277] Fix | Delete
* Show minimal remorse if the correct hook is used.
[278] Fix | Delete
*/
[279] Fix | Delete
$current_filter = current_filter();
[280] Fix | Delete
if ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) ||
[281] Fix | Delete
( 'wp-login.php' === $pagenow && 'login_enqueue_scripts' !== $current_filter )
[282] Fix | Delete
) {
[283] Fix | Delete
$not_allowed = array(
[284] Fix | Delete
'jquery',
[285] Fix | Delete
'jquery-core',
[286] Fix | Delete
'jquery-migrate',
[287] Fix | Delete
'jquery-ui-core',
[288] Fix | Delete
'jquery-ui-accordion',
[289] Fix | Delete
'jquery-ui-autocomplete',
[290] Fix | Delete
'jquery-ui-button',
[291] Fix | Delete
'jquery-ui-datepicker',
[292] Fix | Delete
'jquery-ui-dialog',
[293] Fix | Delete
'jquery-ui-draggable',
[294] Fix | Delete
'jquery-ui-droppable',
[295] Fix | Delete
'jquery-ui-menu',
[296] Fix | Delete
'jquery-ui-mouse',
[297] Fix | Delete
'jquery-ui-position',
[298] Fix | Delete
'jquery-ui-progressbar',
[299] Fix | Delete
'jquery-ui-resizable',
[300] Fix | Delete
'jquery-ui-selectable',
[301] Fix | Delete
'jquery-ui-slider',
[302] Fix | Delete
'jquery-ui-sortable',
[303] Fix | Delete
'jquery-ui-spinner',
[304] Fix | Delete
'jquery-ui-tabs',
[305] Fix | Delete
'jquery-ui-tooltip',
[306] Fix | Delete
'jquery-ui-widget',
[307] Fix | Delete
'underscore',
[308] Fix | Delete
'backbone',
[309] Fix | Delete
);
[310] Fix | Delete
[311] Fix | Delete
if ( in_array( $handle, $not_allowed, true ) ) {
[312] Fix | Delete
_doing_it_wrong(
[313] Fix | Delete
__FUNCTION__,
[314] Fix | Delete
sprintf(
[315] Fix | Delete
/* translators: 1: Script name, 2: wp_enqueue_scripts */
[316] Fix | Delete
__( 'Do not deregister the %1$s script in the administration area. To target the front-end theme, use the %2$s hook.' ),
[317] Fix | Delete
"<code>$handle</code>",
[318] Fix | Delete
'<code>wp_enqueue_scripts</code>'
[319] Fix | Delete
),
[320] Fix | Delete
'3.6.0'
[321] Fix | Delete
);
[322] Fix | Delete
return;
[323] Fix | Delete
}
[324] Fix | Delete
}
[325] Fix | Delete
[326] Fix | Delete
wp_scripts()->remove( $handle );
[327] Fix | Delete
}
[328] Fix | Delete
[329] Fix | Delete
/**
[330] Fix | Delete
* Enqueues a script.
[331] Fix | Delete
*
[332] Fix | Delete
* Registers the script if `$src` provided (does NOT overwrite), and enqueues it.
[333] Fix | Delete
*
[334] Fix | Delete
* @see WP_Dependencies::add()
[335] Fix | Delete
* @see WP_Dependencies::add_data()
[336] Fix | Delete
* @see WP_Dependencies::enqueue()
[337] Fix | Delete
*
[338] Fix | Delete
* @since 2.1.0
[339] Fix | Delete
* @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array.
[340] Fix | Delete
*
[341] Fix | Delete
* @param string $handle Name of the script. Should be unique.
[342] Fix | Delete
* @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
[343] Fix | Delete
* Default empty.
[344] Fix | Delete
* @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
[345] Fix | Delete
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
[346] Fix | Delete
* as a query string for cache busting purposes. If version is set to false, a version
[347] Fix | Delete
* number is automatically added equal to current installed WordPress version.
[348] Fix | Delete
* If set to null, no version is added.
[349] Fix | Delete
* @param array|bool $args {
[350] Fix | Delete
* Optional. An array of additional script loading strategies. Default empty array.
[351] Fix | Delete
* Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false.
[352] Fix | Delete
*
[353] Fix | Delete
* @type string $strategy Optional. If provided, may be either 'defer' or 'async'.
[354] Fix | Delete
* @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'.
[355] Fix | Delete
* }
[356] Fix | Delete
*/
[357] Fix | Delete
function wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $args = array() ) {
[358] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
[359] Fix | Delete
[360] Fix | Delete
$wp_scripts = wp_scripts();
[361] Fix | Delete
[362] Fix | Delete
if ( $src || ! empty( $args ) ) {
[363] Fix | Delete
$_handle = explode( '?', $handle );
[364] Fix | Delete
if ( ! is_array( $args ) ) {
[365] Fix | Delete
$args = array(
[366] Fix | Delete
'in_footer' => (bool) $args,
[367] Fix | Delete
);
[368] Fix | Delete
}
[369] Fix | Delete
[370] Fix | Delete
if ( $src ) {
[371] Fix | Delete
$wp_scripts->add( $_handle[0], $src, $deps, $ver );
[372] Fix | Delete
}
[373] Fix | Delete
if ( ! empty( $args['in_footer'] ) ) {
[374] Fix | Delete
$wp_scripts->add_data( $_handle[0], 'group', 1 );
[375] Fix | Delete
}
[376] Fix | Delete
if ( ! empty( $args['strategy'] ) ) {
[377] Fix | Delete
$wp_scripts->add_data( $_handle[0], 'strategy', $args['strategy'] );
[378] Fix | Delete
}
[379] Fix | Delete
}
[380] Fix | Delete
[381] Fix | Delete
$wp_scripts->enqueue( $handle );
[382] Fix | Delete
}
[383] Fix | Delete
[384] Fix | Delete
/**
[385] Fix | Delete
* Removes a previously enqueued script.
[386] Fix | Delete
*
[387] Fix | Delete
* @see WP_Dependencies::dequeue()
[388] Fix | Delete
*
[389] Fix | Delete
* @since 3.1.0
[390] Fix | Delete
*
[391] Fix | Delete
* @param string $handle Name of the script to be removed.
[392] Fix | Delete
*/
[393] Fix | Delete
function wp_dequeue_script( $handle ) {
[394] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
[395] Fix | Delete
[396] Fix | Delete
wp_scripts()->dequeue( $handle );
[397] Fix | Delete
}
[398] Fix | Delete
[399] Fix | Delete
/**
[400] Fix | Delete
* Determines whether a script has been added to the queue.
[401] Fix | Delete
*
[402] Fix | Delete
* For more information on this and similar theme functions, check out
[403] Fix | Delete
* the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
[404] Fix | Delete
* Conditional Tags} article in the Theme Developer Handbook.
[405] Fix | Delete
*
[406] Fix | Delete
* @since 2.8.0
[407] Fix | Delete
* @since 3.5.0 'enqueued' added as an alias of the 'queue' list.
[408] Fix | Delete
*
[409] Fix | Delete
* @param string $handle Name of the script.
[410] Fix | Delete
* @param string $status Optional. Status of the script to check. Default 'enqueued'.
[411] Fix | Delete
* Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.
[412] Fix | Delete
* @return bool Whether the script is queued.
[413] Fix | Delete
*/
[414] Fix | Delete
function wp_script_is( $handle, $status = 'enqueued' ) {
[415] Fix | Delete
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
[416] Fix | Delete
[417] Fix | Delete
return (bool) wp_scripts()->query( $handle, $status );
[418] Fix | Delete
}
[419] Fix | Delete
[420] Fix | Delete
/**
[421] Fix | Delete
* Adds metadata to a script.
[422] Fix | Delete
*
[423] Fix | Delete
* Works only if the script has already been registered.
[424] Fix | Delete
*
[425] Fix | Delete
* Possible values for $key and $value:
[426] Fix | Delete
* 'conditional' string Comments for IE 6, lte IE 7, etc.
[427] Fix | Delete
*
[428] Fix | Delete
* @since 4.2.0
[429] Fix | Delete
*
[430] Fix | Delete
* @see WP_Dependencies::add_data()
[431] Fix | Delete
*
[432] Fix | Delete
* @param string $handle Name of the script.
[433] Fix | Delete
* @param string $key Name of data point for which we're storing a value.
[434] Fix | Delete
* @param mixed $value String containing the data to be added.
[435] Fix | Delete
* @return bool True on success, false on failure.
[436] Fix | Delete
*/
[437] Fix | Delete
function wp_script_add_data( $handle, $key, $value ) {
[438] Fix | Delete
return wp_scripts()->add_data( $handle, $key, $value );
[439] Fix | Delete
}
[440] Fix | Delete
[441] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function