Support » Plugin: Bainternet Posts Creation Limits » Undefined variable (with fix)

  • Resolved Austin Passy


    You have a undefined variable notice in your plugin at line 150.

    $rules_BY_id = $this->get_sub_array($options['rules'],'role',$current_user->ID);

    Were $current_user is only getting set if the $user_id is null. That function should get the global removed and set a top the function.

    if ($user_id == null){
    	$user_id = $current_user->ID;
    	if ($user_id <= 0)
    		return true;

    Also note the uppercase ID as id is deprecated.

    So the function should look like:

    public function limitUser($user_id = null,$type = null,$use_m = true){
    	global $current_user;

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bainternet


    How about just replacing $current_user->ID with $user_id since the only real use and declaration $current_user is to set $user_id of and changing the id to uppercase?

    seems much simpler to me.

    will fix soon

    Plugin Author Bainternet



    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Undefined variable (with fix)’ is closed to new replies.