Php Wordpress:;警告:非法字符串偏移量“;在多个地方
希望你们能帮我。我的WordPress安装中出现了什么问题,请参阅错误和引用的代码块 错误:Php Wordpress:;警告:非法字符串偏移量“;在多个地方,php,wordpress,error-handling,syntax-error,Php,Wordpress,Error Handling,Syntax Error,希望你们能帮我。我的WordPress安装中出现了什么问题,请参阅错误和引用的代码块 错误: Warning: Illegal string offset 'domain' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 583 Warning: Illegal string offset 'context' in /home/customer/www/xxxxxxxx.xxx/public
Warning: Illegal string offset 'domain' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 583
Warning: Illegal string offset 'context' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 587
Warning: Illegal string offset 'singular' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 588
Warning: Illegal string offset 'plural' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 588
Warning: Illegal string offset 'context' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 588
Warning: Illegal string offset 'domain' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 583
Warning: Illegal string offset 'context' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 587
Warning: Illegal string offset 'singular' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 588
Warning: Illegal string offset 'plural' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 588
Warning: Illegal string offset 'context' in /home/customer/www/xxxxxxxx.xxx/public_html/wp-includes/l10n.php on line 588
代码:
警告:非法字符串偏移量'something'
消息表示您试图访问$someVar['something']
的值,但该值不存在
为了避免这种情况,您应该始终使用
isset($someVar['something'])
来检查给定变量中是否存在索引。将if($nooped\u复数['context'])
更改为if(isset($nooped\u复数['context'])
不幸的是,仍然提供以下错误:警告:第583行/home/customer/www/xxx.xxx/public_html/wp-includes/l10n.php中的非法字符串偏移量“domain”警告:第590行/home/customer/www/xxx.xxx/public_html/wp-includes/l10n.php中的非法字符串偏移量“singular”警告:第590行中的非法字符串偏移量“复数”/home/customer/www/xxx.xxx/public_html/wp-includes/l10n.php第590行
为此,我去更改了该部分中所有未完成的变量,但没有添加“isset”关键字。
function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {
if ( $nooped_plural['domain'] ) {
$domain = $nooped_plural['domain'];
}
if ( $nooped_plural['context'] ) {
return _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );
} else {
return _n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain );
}
}