Wordpress Open Social Error:"Strict Standards: Only variables should be passed by reference"
Wordpress Open Social Error:"Strict Standards: Only variables should be passed by reference"
我在 Wordpress 中使用 Open Social Plugin。我还安装了调试插件以查看发生了什么。我收到 PHP 错误 说:
Strict Standards: Only variables should be passed by reference in /wp-content/plugins/open-social/open-social.php on line 111.
第 111 行打开-social.php:
'google'=>"http://translate.google.com.hk/translate?hl=".(isset($_SESSION['WPLANG_LOCALE'])?$_SESSION['WPLANG_LOCALE']:'en_US')."&sl=zh-CN&tl=".(isset($_SESSION['WPLANG_LOCALE'])?reset(str_split($_SESSION['WPLANG_LOCALE'],2)):'en')."&u=%URL%"
有谁知道这条线有什么问题吗?我卡在这里了。
你的问题是这样的:
reset(str_split($_SESSION['WPLANG_LOCALE'],2))
您正在尝试 reset
str_split
的 return 值;您只能 reset
一个变量,而不是一个表达式值。见the docs for reset
,表明声明为mixed reset (array &$array)
.
我不是 100% 清楚你在这里用 reset
做什么。我怀疑您只想要 str_split
值,在这种情况下您不需要 reset
任何东西。
我在 Wordpress 中使用 Open Social Plugin。我还安装了调试插件以查看发生了什么。我收到 PHP 错误 说:
Strict Standards: Only variables should be passed by reference in /wp-content/plugins/open-social/open-social.php on line 111.
第 111 行打开-social.php:
'google'=>"http://translate.google.com.hk/translate?hl=".(isset($_SESSION['WPLANG_LOCALE'])?$_SESSION['WPLANG_LOCALE']:'en_US')."&sl=zh-CN&tl=".(isset($_SESSION['WPLANG_LOCALE'])?reset(str_split($_SESSION['WPLANG_LOCALE'],2)):'en')."&u=%URL%"
有谁知道这条线有什么问题吗?我卡在这里了。
你的问题是这样的:
reset(str_split($_SESSION['WPLANG_LOCALE'],2))
您正在尝试 reset
str_split
的 return 值;您只能 reset
一个变量,而不是一个表达式值。见the docs for reset
,表明声明为mixed reset (array &$array)
.
我不是 100% 清楚你在这里用 reset
做什么。我怀疑您只想要 str_split
值,在这种情况下您不需要 reset
任何东西。