WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] [Plugin: Aleph] users hardcoded at 15?

[Resolved] [Plugin: Aleph] users hardcoded at 15?

  • Is there a way to bypass the hardcoded limit of 15 users per page? I tweaked UserQuery.php:

    $q['users_per_page'] = apply_filters('users_per_page', 15);

    to

    $q['users_per_page'] = apply_filters('users_per_page', 99);

    but it doesn’t seem to make any difference at all. Where else should I go look for this?

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Apache was caching things, this does work. Shame to have to have this hardcoded, though.

    Hi, it’s not hardcoded because you can create a filter and change the value from another plugin or from your current template 🙂 Just like this:

    function change_users_per_page($users) { return 99; }
    add_filter('users_per_page', 99);

    In this way, if you upgrade to the next version (currently in the works) you will not lose your changes.

    But I’m glad you got it working.

    Hi
    I’m using a function to separate contributors users from authors users, actually it works fine, but only give me 50 users.

    I figured out 50 was define in /wp-admin/includes/users.php but i don’t know how to modify this number, i’m pretty sure that this piece of code can help me, but i tried to put it in my plugin file or in my theme functions.php; nothing works…

    This is the script i use to separates users ID:

    function getAllUsersWithRole($role) {
    
    		$wp_user_search = new WP_User_Search($usersearch, $userspage, $role);
    		return $wp_user_search->get_results();
    
    	}
    
    	if ($_GET['users'] && $_GET['users'] == 'author') {
    
    		$IDs = getAllUsersWithRole('author');
    
    	} elseif ($_GET['users'] && $_GET['users'] == 'subscriber') {
    
    		$IDs = getAllUsersWithRole('subscriber');
    
    	} elseif ($_GET['users'] && $_GET['users'] == 'mix') {
    
    		$ID1s = getAllUsersWithRole('author');
    		$ID2s = getAllUsersWithRole('subscriber');
    
      		$IDs = array_merge ($ID1s, $ID2s);
    
    	} else {
    
    		$IDs = getAllUsersWithRole('subscriber');
    
    	}

    Any help is accepted, thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Aleph] users hardcoded at 15?’ is closed to new replies.
Skip to toolbar