php - Fatal error: Cannot re-assign auto-global variable _POST -
i can't access wp (version3.4.2) admin. says mentioned above
fatal error: cannot re-assign auto-global variable _post in /home/xxx/public_html/wp-content/themes/rtthemes16/rt-framework/classes/admin.php on line 540.
the line 540 :
function rt_check_sidebar_array($_post){ if(is_array($_post)){ $start_unset_count = 0; foreach($_post $key => $value){ if(stristr($key, '_sidebar_name') == true && $value=="") { unset($_post[$key]); $start_unset_count = 1; } if($start_unset_count>0){ unset($_post[$key]); $start_unset_count++; } if($start_unset_count==6){ $start_unset_count = 0; } } } $newpost == $newpost ? $newpost : $_post; return $_post; }
any insights? :)
since php 5.4, cannot use superglobal parameter function
$_post globally accessible. don't have pass function.
http://php.net/manual/en/language.variables.superglobals.php#112184
this how function should like
function rt_check_sidebar_array(){ if(is_array($_post)){ $start_unset_count = 0; foreach($_post $key => $value){ if(stristr($key, '_sidebar_name') == true && $value=="") { unset($_post[$key]); $start_unset_count = 1; } if($start_unset_count>0){ unset($_post[$key]); $start_unset_count++; } if($start_unset_count==6){ $start_unset_count = 0; } } } $newpost == $newpost ? $newpost : $_post; return $_post; }
Comments
Post a Comment