Wordpress:“警告:非法字符串偏移”在多个地方

希望你们能在这里帮助我。在我的 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

代码:


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 );

    }

}


慕神8447489
浏览 130回答 1
1回答

幕布斯6054654

Warning: Illegal string offset 'something'消息意味着您正在尝试访问的值,$someVar['something']但它不存在。为避免这种情况,您应该始终使用isset($someVar['something'])检查给定变量中是否存在(或不存在)索引。
打开App,查看更多内容
随时随地看视频慕课网APP