WordPress.org

Ready to get started?Download WordPress

Forums

Simple User Listing
[resolved] include / exclude (6 posts)

  1. fencer019
    Member
    Posted 7 months ago #

    Is it possible to add a parameter to include or exclude certain users?

    http://wordpress.org/plugins/simple-user-listing/

  2. helgatheviking
    Member
    Plugin Author

    Posted 7 months ago #

    In the shortcode? At this moment, no. But you can always filter either sul_user_query_args or pre_user_query. I will consider adding support for the WP_User_Query parameters... it shouldn't be overly hard.

  3. creamille
    Member
    Posted 5 months ago #

    Hi!

    Since I'm not a web developper, I don't really know if it's correct, but it worked for me.

    I had a list of registered users (mainly contributors, but also 3 admins including me) and I didn't want to appear in this list. So the only solution for me was to only exclude my profile (ID), not a type of users.

    In the simple-user-listing.php l.137, I added :

    'exclude' => array( 1 ),

    $args = array(
    				'query_id' => 'simple_user_listing',
    				'exclude' => array( 1 ),
    				'offset' => $offset,
    				'number' => $number,
    				'orderby' => $orderby,
    				'order' => $order,
    				'role' => $role
    			);

    I was the first user registered ("1") but you could easily replace this ID by finding yours in your SQL file.
    It seems to work pretty well, so maybe it could help...

  4. helgatheviking
    Member
    Plugin Author

    Posted 5 months ago #

    Please don't hard-code something like that in the plugin source, you'll lose your changes as soon as you upgrade.

    [userlist exclude="1"]

    will work in the next update... which I will try to push out in a few days.

  5. creamille
    Member
    Posted 5 months ago #

    Ok, my bad! I need this feature to work now, so I leave it like this for now and when the next update is available, I will use this shortcode. Thanks for your prompt answer :)

  6. helgatheviking
    Member
    Plugin Author

    Posted 5 months ago #

    I just pushed it live, so check for updates in your dashboard.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.