Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress:;警告:非法字符串偏移量“;在多个地方_Php_Wordpress_Error Handling_Syntax Error - Fatal编程技术网

Php 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

希望你们能帮我。我的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_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 );
    }
}