I am using the Open Social Plugin in WordPress. I also installed the Debug Plugin to see what is going on. I get a PHP Error saying:
Strict Standards: Only variables should be passed by reference in /wp-content/plugins/open-social/open-social.php on line 111.
Line 111 in open-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%"
Does anyone know what is wrong with this line? I am stuck here.
Your problem is this:
You are trying to
reset
the return value ofstr_split
; you can onlyreset
a variable, not an expression value. See the docs forreset
, which show that it is declared asmixed reset (array &$array)
.It’s not 100% clear to me what you are trying to do with
reset
here. I suspect you just want thestr_split
value, in which case you don’t need toreset
anything.