Edit File by line
/home/barbar84/public_h.../wp-inclu...
File: class.wp-scripts.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Dependencies API: WP_Scripts class
[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
* Core class used to register scripts.
[11] Fix | Delete
*
[12] Fix | Delete
* @since 2.1.0
[13] Fix | Delete
*
[14] Fix | Delete
* @see WP_Dependencies
[15] Fix | Delete
*/
[16] Fix | Delete
class WP_Scripts extends WP_Dependencies {
[17] Fix | Delete
/**
[18] Fix | Delete
* Base URL for scripts.
[19] Fix | Delete
*
[20] Fix | Delete
* Full URL with trailing slash.
[21] Fix | Delete
*
[22] Fix | Delete
* @since 2.6.0
[23] Fix | Delete
* @var string
[24] Fix | Delete
*/
[25] Fix | Delete
public $base_url;
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* URL of the content directory.
[29] Fix | Delete
*
[30] Fix | Delete
* @since 2.8.0
[31] Fix | Delete
* @var string
[32] Fix | Delete
*/
[33] Fix | Delete
public $content_url;
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* Default version string for scripts.
[37] Fix | Delete
*
[38] Fix | Delete
* @since 2.6.0
[39] Fix | Delete
* @var string
[40] Fix | Delete
*/
[41] Fix | Delete
public $default_version;
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Holds handles of scripts which are enqueued in footer.
[45] Fix | Delete
*
[46] Fix | Delete
* @since 2.8.0
[47] Fix | Delete
* @var array
[48] Fix | Delete
*/
[49] Fix | Delete
public $in_footer = array();
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Holds a list of script handles which will be concatenated.
[53] Fix | Delete
*
[54] Fix | Delete
* @since 2.8.0
[55] Fix | Delete
* @var string
[56] Fix | Delete
*/
[57] Fix | Delete
public $concat = '';
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Holds a string which contains script handles and their version.
[61] Fix | Delete
*
[62] Fix | Delete
* @since 2.8.0
[63] Fix | Delete
* @deprecated 3.4.0
[64] Fix | Delete
* @var string
[65] Fix | Delete
*/
[66] Fix | Delete
public $concat_version = '';
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Whether to perform concatenation.
[70] Fix | Delete
*
[71] Fix | Delete
* @since 2.8.0
[72] Fix | Delete
* @var bool
[73] Fix | Delete
*/
[74] Fix | Delete
public $do_concat = false;
[75] Fix | Delete
[76] Fix | Delete
/**
[77] Fix | Delete
* Holds HTML markup of scripts and additional data if concatenation
[78] Fix | Delete
* is enabled.
[79] Fix | Delete
*
[80] Fix | Delete
* @since 2.8.0
[81] Fix | Delete
* @var string
[82] Fix | Delete
*/
[83] Fix | Delete
public $print_html = '';
[84] Fix | Delete
[85] Fix | Delete
/**
[86] Fix | Delete
* Holds inline code if concatenation is enabled.
[87] Fix | Delete
*
[88] Fix | Delete
* @since 2.8.0
[89] Fix | Delete
* @var string
[90] Fix | Delete
*/
[91] Fix | Delete
public $print_code = '';
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Holds a list of script handles which are not in the default directory
[95] Fix | Delete
* if concatenation is enabled.
[96] Fix | Delete
*
[97] Fix | Delete
* Unused in core.
[98] Fix | Delete
*
[99] Fix | Delete
* @since 2.8.0
[100] Fix | Delete
* @var string
[101] Fix | Delete
*/
[102] Fix | Delete
public $ext_handles = '';
[103] Fix | Delete
[104] Fix | Delete
/**
[105] Fix | Delete
* Holds a string which contains handles and versions of scripts which
[106] Fix | Delete
* are not in the default directory if concatenation is enabled.
[107] Fix | Delete
*
[108] Fix | Delete
* Unused in core.
[109] Fix | Delete
*
[110] Fix | Delete
* @since 2.8.0
[111] Fix | Delete
* @var string
[112] Fix | Delete
*/
[113] Fix | Delete
public $ext_version = '';
[114] Fix | Delete
[115] Fix | Delete
/**
[116] Fix | Delete
* List of default directories.
[117] Fix | Delete
*
[118] Fix | Delete
* @since 2.8.0
[119] Fix | Delete
* @var array
[120] Fix | Delete
*/
[121] Fix | Delete
public $default_dirs;
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* Holds a string which contains the type attribute for script tag.
[125] Fix | Delete
*
[126] Fix | Delete
* If the current theme does not declare HTML5 support for 'script',
[127] Fix | Delete
* then it initializes as `type='text/javascript'`.
[128] Fix | Delete
*
[129] Fix | Delete
* @since 5.3.0
[130] Fix | Delete
* @var string
[131] Fix | Delete
*/
[132] Fix | Delete
private $type_attr = '';
[133] Fix | Delete
[134] Fix | Delete
/**
[135] Fix | Delete
* Constructor.
[136] Fix | Delete
*
[137] Fix | Delete
* @since 2.6.0
[138] Fix | Delete
*/
[139] Fix | Delete
public function __construct() {
[140] Fix | Delete
$this->init();
[141] Fix | Delete
add_action( 'init', array( $this, 'init' ), 0 );
[142] Fix | Delete
}
[143] Fix | Delete
[144] Fix | Delete
/**
[145] Fix | Delete
* Initialize the class.
[146] Fix | Delete
*
[147] Fix | Delete
* @since 3.4.0
[148] Fix | Delete
*/
[149] Fix | Delete
public function init() {
[150] Fix | Delete
if (
[151] Fix | Delete
function_exists( 'is_admin' ) && ! is_admin()
[152] Fix | Delete
&&
[153] Fix | Delete
function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'script' )
[154] Fix | Delete
) {
[155] Fix | Delete
$this->type_attr = " type='text/javascript'";
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
/**
[159] Fix | Delete
* Fires when the WP_Scripts instance is initialized.
[160] Fix | Delete
*
[161] Fix | Delete
* @since 2.6.0
[162] Fix | Delete
*
[163] Fix | Delete
* @param WP_Scripts $this WP_Scripts instance (passed by reference).
[164] Fix | Delete
*/
[165] Fix | Delete
do_action_ref_array( 'wp_default_scripts', array( &$this ) );
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
/**
[169] Fix | Delete
* Prints scripts.
[170] Fix | Delete
*
[171] Fix | Delete
* Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
[172] Fix | Delete
*
[173] Fix | Delete
* @since 2.1.0
[174] Fix | Delete
* @since 2.8.0 Added the `$group` parameter.
[175] Fix | Delete
*
[176] Fix | Delete
* @param string|string[]|false $handles Optional. Scripts to be printed: queue (false),
[177] Fix | Delete
* single script (string), or multiple scripts (array of strings).
[178] Fix | Delete
* Default false.
[179] Fix | Delete
* @param int|false $group Optional. Group level: level (int), no groups (false).
[180] Fix | Delete
* Default false.
[181] Fix | Delete
* @return string[] Handles of scripts that have been printed.
[182] Fix | Delete
*/
[183] Fix | Delete
public function print_scripts( $handles = false, $group = false ) {
[184] Fix | Delete
return $this->do_items( $handles, $group );
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
/**
[188] Fix | Delete
* Prints extra scripts of a registered script.
[189] Fix | Delete
*
[190] Fix | Delete
* @since 2.1.0
[191] Fix | Delete
* @since 2.8.0 Added the `$echo` parameter.
[192] Fix | Delete
* @deprecated 3.3.0
[193] Fix | Delete
*
[194] Fix | Delete
* @see print_extra_script()
[195] Fix | Delete
*
[196] Fix | Delete
* @param string $handle The script's registered handle.
[197] Fix | Delete
* @param bool $echo Optional. Whether to echo the extra script
[198] Fix | Delete
* instead of just returning it. Default true.
[199] Fix | Delete
* @return bool|string|void Void if no data exists, extra scripts if `$echo` is true,
[200] Fix | Delete
* true otherwise.
[201] Fix | Delete
*/
[202] Fix | Delete
public function print_scripts_l10n( $handle, $echo = true ) {
[203] Fix | Delete
_deprecated_function( __FUNCTION__, '3.3.0', 'WP_Scripts::print_extra_script()' );
[204] Fix | Delete
return $this->print_extra_script( $handle, $echo );
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
/**
[208] Fix | Delete
* Prints extra scripts of a registered script.
[209] Fix | Delete
*
[210] Fix | Delete
* @since 3.3.0
[211] Fix | Delete
*
[212] Fix | Delete
* @param string $handle The script's registered handle.
[213] Fix | Delete
* @param bool $echo Optional. Whether to echo the extra script
[214] Fix | Delete
* instead of just returning it. Default true.
[215] Fix | Delete
* @return bool|string|void Void if no data exists, extra scripts if `$echo` is true,
[216] Fix | Delete
* true otherwise.
[217] Fix | Delete
*/
[218] Fix | Delete
public function print_extra_script( $handle, $echo = true ) {
[219] Fix | Delete
$output = $this->get_data( $handle, 'data' );
[220] Fix | Delete
if ( ! $output ) {
[221] Fix | Delete
return;
[222] Fix | Delete
}
[223] Fix | Delete
[224] Fix | Delete
if ( ! $echo ) {
[225] Fix | Delete
return $output;
[226] Fix | Delete
}
[227] Fix | Delete
[228] Fix | Delete
printf( "<script%s id='%s-js-extra'>\n", $this->type_attr, esc_attr( $handle ) );
[229] Fix | Delete
[230] Fix | Delete
// CDATA is not needed for HTML 5.
[231] Fix | Delete
if ( $this->type_attr ) {
[232] Fix | Delete
echo "/* <![CDATA[ */\n";
[233] Fix | Delete
}
[234] Fix | Delete
[235] Fix | Delete
echo "$output\n";
[236] Fix | Delete
[237] Fix | Delete
if ( $this->type_attr ) {
[238] Fix | Delete
echo "/* ]]> */\n";
[239] Fix | Delete
}
[240] Fix | Delete
[241] Fix | Delete
echo "</script>\n";
[242] Fix | Delete
[243] Fix | Delete
return true;
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
/**
[247] Fix | Delete
* Processes a script dependency.
[248] Fix | Delete
*
[249] Fix | Delete
* @since 2.6.0
[250] Fix | Delete
* @since 2.8.0 Added the `$group` parameter.
[251] Fix | Delete
*
[252] Fix | Delete
* @see WP_Dependencies::do_item()
[253] Fix | Delete
*
[254] Fix | Delete
* @param string $handle The script's registered handle.
[255] Fix | Delete
* @param int|false $group Optional. Group level: level (int), no groups (false).
[256] Fix | Delete
* Default false.
[257] Fix | Delete
* @return bool True on success, false on failure.
[258] Fix | Delete
*/
[259] Fix | Delete
public function do_item( $handle, $group = false ) {
[260] Fix | Delete
if ( ! parent::do_item( $handle ) ) {
[261] Fix | Delete
return false;
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
if ( 0 === $group && $this->groups[ $handle ] > 0 ) {
[265] Fix | Delete
$this->in_footer[] = $handle;
[266] Fix | Delete
return false;
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
if ( false === $group && in_array( $handle, $this->in_footer, true ) ) {
[270] Fix | Delete
$this->in_footer = array_diff( $this->in_footer, (array) $handle );
[271] Fix | Delete
}
[272] Fix | Delete
[273] Fix | Delete
$obj = $this->registered[ $handle ];
[274] Fix | Delete
[275] Fix | Delete
if ( null === $obj->ver ) {
[276] Fix | Delete
$ver = '';
[277] Fix | Delete
} else {
[278] Fix | Delete
$ver = $obj->ver ? $obj->ver : $this->default_version;
[279] Fix | Delete
}
[280] Fix | Delete
[281] Fix | Delete
if ( isset( $this->args[ $handle ] ) ) {
[282] Fix | Delete
$ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ];
[283] Fix | Delete
}
[284] Fix | Delete
[285] Fix | Delete
$src = $obj->src;
[286] Fix | Delete
$cond_before = '';
[287] Fix | Delete
$cond_after = '';
[288] Fix | Delete
$conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : '';
[289] Fix | Delete
[290] Fix | Delete
if ( $conditional ) {
[291] Fix | Delete
$cond_before = "<!--[if {$conditional}]>\n";
[292] Fix | Delete
$cond_after = "<![endif]-->\n";
[293] Fix | Delete
}
[294] Fix | Delete
[295] Fix | Delete
$before_handle = $this->print_inline_script( $handle, 'before', false );
[296] Fix | Delete
$after_handle = $this->print_inline_script( $handle, 'after', false );
[297] Fix | Delete
[298] Fix | Delete
if ( $before_handle ) {
[299] Fix | Delete
$before_handle = sprintf( "<script%s id='%s-js-before'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $before_handle );
[300] Fix | Delete
}
[301] Fix | Delete
[302] Fix | Delete
if ( $after_handle ) {
[303] Fix | Delete
$after_handle = sprintf( "<script%s id='%s-js-after'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $after_handle );
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
if ( $before_handle || $after_handle ) {
[307] Fix | Delete
$inline_script_tag = $cond_before . $before_handle . $after_handle . $cond_after;
[308] Fix | Delete
} else {
[309] Fix | Delete
$inline_script_tag = '';
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
$translations = $this->print_translations( $handle, false );
[313] Fix | Delete
if ( $translations ) {
[314] Fix | Delete
$translations = sprintf( "<script%s id='%s-js-translations'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), $translations );
[315] Fix | Delete
}
[316] Fix | Delete
[317] Fix | Delete
if ( $this->do_concat ) {
[318] Fix | Delete
/**
[319] Fix | Delete
* Filters the script loader source.
[320] Fix | Delete
*
[321] Fix | Delete
* @since 2.2.0
[322] Fix | Delete
*
[323] Fix | Delete
* @param string $src Script loader source path.
[324] Fix | Delete
* @param string $handle Script handle.
[325] Fix | Delete
*/
[326] Fix | Delete
$srce = apply_filters( 'script_loader_src', $src, $handle );
[327] Fix | Delete
[328] Fix | Delete
if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations ) ) {
[329] Fix | Delete
$this->do_concat = false;
[330] Fix | Delete
[331] Fix | Delete
// Have to print the so-far concatenated scripts right away to maintain the right order.
[332] Fix | Delete
_print_scripts();
[333] Fix | Delete
$this->reset();
[334] Fix | Delete
} elseif ( $this->in_default_dir( $srce ) && ! $conditional ) {
[335] Fix | Delete
$this->print_code .= $this->print_extra_script( $handle, false );
[336] Fix | Delete
$this->concat .= "$handle,";
[337] Fix | Delete
$this->concat_version .= "$handle$ver";
[338] Fix | Delete
return true;
[339] Fix | Delete
} else {
[340] Fix | Delete
$this->ext_handles .= "$handle,";
[341] Fix | Delete
$this->ext_version .= "$handle$ver";
[342] Fix | Delete
}
[343] Fix | Delete
}
[344] Fix | Delete
[345] Fix | Delete
$has_conditional_data = $conditional && $this->get_data( $handle, 'data' );
[346] Fix | Delete
[347] Fix | Delete
if ( $has_conditional_data ) {
[348] Fix | Delete
echo $cond_before;
[349] Fix | Delete
}
[350] Fix | Delete
[351] Fix | Delete
$this->print_extra_script( $handle );
[352] Fix | Delete
[353] Fix | Delete
if ( $has_conditional_data ) {
[354] Fix | Delete
echo $cond_after;
[355] Fix | Delete
}
[356] Fix | Delete
[357] Fix | Delete
// A single item may alias a set of items, by having dependencies, but no source.
[358] Fix | Delete
if ( ! $src ) {
[359] Fix | Delete
if ( $inline_script_tag ) {
[360] Fix | Delete
if ( $this->do_concat ) {
[361] Fix | Delete
$this->print_html .= $inline_script_tag;
[362] Fix | Delete
} else {
[363] Fix | Delete
echo $inline_script_tag;
[364] Fix | Delete
}
[365] Fix | Delete
}
[366] Fix | Delete
[367] Fix | Delete
return true;
[368] Fix | Delete
}
[369] Fix | Delete
[370] Fix | Delete
if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {
[371] Fix | Delete
$src = $this->base_url . $src;
[372] Fix | Delete
}
[373] Fix | Delete
[374] Fix | Delete
if ( ! empty( $ver ) ) {
[375] Fix | Delete
$src = add_query_arg( 'ver', $ver, $src );
[376] Fix | Delete
}
[377] Fix | Delete
[378] Fix | Delete
/** This filter is documented in wp-includes/class.wp-scripts.php */
[379] Fix | Delete
$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
[380] Fix | Delete
[381] Fix | Delete
if ( ! $src ) {
[382] Fix | Delete
return true;
[383] Fix | Delete
}
[384] Fix | Delete
[385] Fix | Delete
$tag = $translations . $cond_before . $before_handle;
[386] Fix | Delete
$tag .= sprintf( "<script%s src='%s' id='%s-js'></script>\n", $this->type_attr, $src, esc_attr( $handle ) );
[387] Fix | Delete
$tag .= $after_handle . $cond_after;
[388] Fix | Delete
[389] Fix | Delete
/**
[390] Fix | Delete
* Filters the HTML script tag of an enqueued script.
[391] Fix | Delete
*
[392] Fix | Delete
* @since 4.1.0
[393] Fix | Delete
*
[394] Fix | Delete
* @param string $tag The `<script>` tag for the enqueued script.
[395] Fix | Delete
* @param string $handle The script's registered handle.
[396] Fix | Delete
* @param string $src The script's source URL.
[397] Fix | Delete
*/
[398] Fix | Delete
$tag = apply_filters( 'script_loader_tag', $tag, $handle, $src );
[399] Fix | Delete
[400] Fix | Delete
if ( $this->do_concat ) {
[401] Fix | Delete
$this->print_html .= $tag;
[402] Fix | Delete
} else {
[403] Fix | Delete
echo $tag;
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
return true;
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
/**
[410] Fix | Delete
* Adds extra code to a registered script.
[411] Fix | Delete
*
[412] Fix | Delete
* @since 4.5.0
[413] Fix | Delete
*
[414] Fix | Delete
* @param string $handle Name of the script to add the inline script to.
[415] Fix | Delete
* Must be lowercase.
[416] Fix | Delete
* @param string $data String containing the JavaScript to be added.
[417] Fix | Delete
* @param string $position Optional. Whether to add the inline script
[418] Fix | Delete
* before the handle or after. Default 'after'.
[419] Fix | Delete
* @return bool True on success, false on failure.
[420] Fix | Delete
*/
[421] Fix | Delete
public function add_inline_script( $handle, $data, $position = 'after' ) {
[422] Fix | Delete
if ( ! $data ) {
[423] Fix | Delete
return false;
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
if ( 'after' !== $position ) {
[427] Fix | Delete
$position = 'before';
[428] Fix | Delete
}
[429] Fix | Delete
[430] Fix | Delete
$script = (array) $this->get_data( $handle, $position );
[431] Fix | Delete
$script[] = $data;
[432] Fix | Delete
[433] Fix | Delete
return $this->add_data( $handle, $position, $script );
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
/**
[437] Fix | Delete
* Prints inline scripts registered for a specific handle.
[438] Fix | Delete
*
[439] Fix | Delete
* @since 4.5.0
[440] Fix | Delete
*
[441] Fix | Delete
* @param string $handle Name of the script to add the inline script to.
[442] Fix | Delete
* Must be lowercase.
[443] Fix | Delete
* @param string $position Optional. Whether to add the inline script
[444] Fix | Delete
* before the handle or after. Default 'after'.
[445] Fix | Delete
* @param bool $echo Optional. Whether to echo the script
[446] Fix | Delete
* instead of just returning it. Default true.
[447] Fix | Delete
* @return string|false Script on success, false otherwise.
[448] Fix | Delete
*/
[449] Fix | Delete
public function print_inline_script( $handle, $position = 'after', $echo = true ) {
[450] Fix | Delete
$output = $this->get_data( $handle, $position );
[451] Fix | Delete
[452] Fix | Delete
if ( empty( $output ) ) {
[453] Fix | Delete
return false;
[454] Fix | Delete
}
[455] Fix | Delete
[456] Fix | Delete
$output = trim( implode( "\n", $output ), "\n" );
[457] Fix | Delete
[458] Fix | Delete
if ( $echo ) {
[459] Fix | Delete
printf( "<script%s id='%s-js-%s'>\n%s\n</script>\n", $this->type_attr, esc_attr( $handle ), esc_attr( $position ), $output );
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
return $output;
[463] Fix | Delete
}
[464] Fix | Delete
[465] Fix | Delete
/**
[466] Fix | Delete
* Localizes a script, only if the script has already been added.
[467] Fix | Delete
*
[468] Fix | Delete
* @since 2.1.0
[469] Fix | Delete
*
[470] Fix | Delete
* @param string $handle Name of the script to attach data to.
[471] Fix | Delete
* @param string $object_name Name of the variable that will contain the data.
[472] Fix | Delete
* @param array $l10n Array of data to localize.
[473] Fix | Delete
* @return bool True on success, false on failure.
[474] Fix | Delete
*/
[475] Fix | Delete
public function localize( $handle, $object_name, $l10n ) {
[476] Fix | Delete
if ( 'jquery' === $handle ) {
[477] Fix | Delete
$handle = 'jquery-core';
[478] Fix | Delete
}
[479] Fix | Delete
[480] Fix | Delete
if ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present.
[481] Fix | Delete
$after = $l10n['l10n_print_after'];
[482] Fix | Delete
unset( $l10n['l10n_print_after'] );
[483] Fix | Delete
}
[484] Fix | Delete
[485] Fix | Delete
if ( ! is_array( $l10n ) ) {
[486] Fix | Delete
_doing_it_wrong(
[487] Fix | Delete
__METHOD__,
[488] Fix | Delete
sprintf(
[489] Fix | Delete
/* translators: 1: $l10n, 2: wp_add_inline_script() */
[490] Fix | Delete
__( 'The %1$s parameter must be an array. To pass arbitrary data to scripts, use the %2$s function instead.' ),
[491] Fix | Delete
'<code>$l10n</code>',
[492] Fix | Delete
'<code>wp_add_inline_script()</code>'
[493] Fix | Delete
),
[494] Fix | Delete
'5.7.0'
[495] Fix | Delete
);
[496] Fix | Delete
}
[497] Fix | Delete
[498] Fix | Delete
if ( is_string( $l10n ) ) {
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function