偏移警告當我加載它顯示以下警告頁面:無法分配一個空字符串爲一個字符串在WordPress的
警告:不能爲空字符串賦值給一個字符串 C的失調:XAMPP \ htdocs中\ WordPress的\智能-M \ WP-包括\上 線class.wp-scripts.php 447
我認爲它不符合邏輯的問題。可以是WordPress的東西? 這是上線447
public function localize($handle, $object_name, $l10n) {
if ($handle === 'jquery')
$handle = 'jquery-core';
if (is_array($l10n) && isset($l10n['l10n_print_after'])) { // back compat, preserve the code in 'l10n_print_after' if present
$after = $l10n['l10n_print_after'];
unset($l10n['l10n_print_after']);
}
foreach ((array) $l10n as $key => $value) {
if (!is_scalar($value))
continue;
$l10n[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
}
$script = "var $object_name = " . wp_json_encode($l10n) . ';';
if (!empty($after))
$script .= "\n$after;";
$data = $this->get_data($handle, 'data');
if (!empty($data))
$script = "$data\n$script";
return $this->add_data($handle, 'data', $script);
}
你可以添加一個解釋,爲什麼這有助於解決這一問題? – yacc