• Resolved chriswebb2001

    (@chriswebb2001)


    There is an excluding users feature, with is great. Would it be possible to add a feature that only includes users with a specific value.
    For example if the database field ‘id’ is 4.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author tbenyon

    (@tbenyon)

    Hey @chriswebb2001,

    This feature already exists. It’s the last block in the settings page.

    Additionally if you need more complex logic for excluding users, check out the FAQ for the question regarding which hooks are available and see the ‘exlog_hook_filter_custom_should_exclude’ hook.

    Let me know if this solves your issue or if you have any more questions 😊
    Tom

    Thread Starter chriswebb2001

    (@chriswebb2001)

    Hey Tbenyon, Thanks for you reply! 🙂
    I see that there is a feature for excluding users. But if I wanted to only include users with a certain value, I would have to put every other value that there is in the table. As I would like to use this value with unique ids.SO is it possible to add an “include users”. I enter 1 value and it only works with users with the value.
    Thanks, Chris.

    Love your plugin btw 🙂

    Plugin Author tbenyon

    (@tbenyon)

    Hey Chris,

    Apologies I misread your first message!

    I could do a reverse of it I guess, it could be a toggle that let you use the fields to exclude OR include.

    The problem is I can then see people wanting to say – include these but exclude those which is where things can get progressively messy and not easy for the average user. Just typing thoughts out loud but always welcome feedback and thoughts on how you see this working.

    This can already be achieved with the hook I mentioned earlier. Note that the plugin blocks the user if it returns true. Therefore in this case if their id is not 4, block them.

    
    function myExlogCustomExcluder($userData) {
        return $userData['id'] != 4;
    }
    add_filter('exlog_hook_filter_custom_should_exclude', 'myExlogCustomExcluder', 10, 1);
    

    If you’re not familiar with where to put this code this plugin may be of use:
    https://en-gb.wordpress.org/plugins/code-snippets/

    Thread Starter chriswebb2001

    (@chriswebb2001)

    Hi tbenyon, ahh I see, I understand that this could make things difficult. I have managed to get it working with the method you suggested so Thanks!. Don’t need to add the feature then? as it wasn’t hard to do with your explanation.
    🙂
    Thanks,
    Chris.

    Plugin Author tbenyon

    (@tbenyon)

    If you’re happy with this solution – I think it is the best route. It adds complete flexibility for all use cases.

    If this becomes a popular request I can re-evaluate.

    Really glad the plugins working for you 🙂

    If you have time, I’d be grateful if you could write a review or even buy me a beer.

    Thanks and good luck with your project 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Feature Requests’ is closed to new replies.