Include only specific users to new message “To” dropdown


Home Forums Front End PM PRO Include only specific users to new message “To” dropdown

This topic is: Not Resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #41880
    eyal.rosen
    Participant

    I wish to be able to control the users list suggested in the “To” drop down in new message creation.
    I see there is an action hook named fep_users_ajax_arguments for this purpose – is that correct?
    Looking a bit deeper (in the code) I see that the $args contains a list to exclude users only.
    I wish to be able to generate the users list myself, hence to have only an “include” list, so basically I include only the users that I wish, based on my functionality.

    How should I do it? (exclude all, include only mine).

    #41890
    shamim
    Keymaster

    You can use fep_filter_rest_users_args hook.
    As $args is supplied to get_users function you can modify any parameters there. you can get supported parameters in https://developer.wordpress.org/reference/classes/wp_user_query/prepare_query/

    #41893
    eyal.rosen
    Participant

    I see that it has “include” option, but how can I exclude all others, make sure that only my “include” will take place?

    #41895
    eyal.rosen
    Participant

    OK, it seems that if adding “include”, it relates only for the ones in the include.
    Is that correct?

    #41906
    shamim
    Keymaster

    Yes, also you can add/unset any parameters if you want from $args. So if you want to unset exclude parameter you can use unset($args['exclude']).

Viewing 5 posts - 1 through 5 (of 5 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.