Support » Plugin: Limit Blogs Per User » Missing argument 2 for wpdb::prepare()

Viewing 1 replies (of 1 total)
  • Replace the function is_user_blog_admin() starting at line 106 of the limit-bogs-per-user.php file in the plugin and ending at line 120 with the following code:

    function is_user_blog_admin($user_id,$blog_id){
        global $wpdb;
    
            $meta_key=$wpdb->prefix.$blog_id.'_capabilities';//.."_user_level";
    	$role_sql="SELECT user_id,meta_value FROM {$wpdb->usermeta} WHERE meta_key=%s";
    
            $role=$wpdb->get_results($wpdb->prepare($role_sql, $meta_key),ARRAY_A);
    	//clean the role
    	$all_user=array_map(array('BPDevLimitBlogsPerUser','serialize_roles'),$role);//we are unserializing the role to make that as an array
    
    	foreach($all_user as $key=>$user_info)
    		if($user_info['meta_value']['administrator']==1&&$user_info['user_id']==$user_id)//if the role is admin
    			return true;
    	return false;
    }

    I ran into this problem also and had to fix the plugin. I am going to try to contact the plugin developer and get it fixed.

Viewing 1 replies (of 1 total)
  • The topic ‘Missing argument 2 for wpdb::prepare()’ is closed to new replies.