WordPress.org

Ready to get started?Download WordPress

Forums

Bainternet Posts Creation Limits
[resolved] Undefined variable (with fix) (3 posts)

  1. Austin Passy
    Member
    Posted 1 year ago #

    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_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){
    	get_currentuserinfo();
    	$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;

    http://wordpress.org/extend/plugins/bainternet-posts-creation-limits/

  2. Bainternet
    Member
    Plugin Author

    Posted 1 year ago #

    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.

    thanks.
    will fix soon

  3. Bainternet
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed.

    Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.