Undefined variable (with fix)
-
You have a undefined variable notice in your plugin at line 150.
150:
$rules_BY_id = $this->get_sub_array($options['rules'],'role',$current_user->ID);Were
$current_useris only getting set if the$user_idis null. That function should get the global removed and set a top the function.if ($user_id == null){ get_currentuserinfo(); $user_id = $current_user->ID; if ($user_id <= 0) return true; }Also note the uppercase ID as
idis deprecated.So the function should look like:
public function limitUser($user_id = null,$type = null,$use_m = true){ global $current_user;http://ww.wp.xz.cn/extend/plugins/bainternet-posts-creation-limits/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Undefined variable (with fix)’ is closed to new replies.