• Hi there

    I am setting up user lists with many meta fields one of which is postcode (UK format)

    I am excluding some roles so the list shows only certain types of users

    I have another user role (not induced in the list) that I want to allow to see pre-filtered user lists that I want to filter on user meta postcode field

    However, I need the postcode field filter to work on part values – for example, for a postcode BN1 4GF, I want the user to show in the filtered list that has BN as its filter.

    End result, user of role 1 views a page showing a list of users with role 2 that partially match a postcode.

    I also need to pass multiple filters to same list.

    all this is because I have a set of users who oversee a segment of another set of users, based on postcodes – but multiple prefixes.

    So User in Role A has an array of postcode prefixes that he is responsible for (TN, BN, SO, PO) – these are stored in a custom meta field or fields.

    User A needs to see a list of Users in role B that match any of the Postcode prefixes that are stored in user A meta

    Hope this makees sense

    I have spent time reading your docs and the support forum and cannot see how to achiev this although I feel it might be possible with the AMR pro plugin or and / or some custom code

    thanks a lot

    joe

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author anmari

    (@anmari)

    Hmm,
    you’d either need to store the ‘BN’ etc in a separate field so that you can select/filter by that postcode prefix.

    OR

    have code to pseudo add a postcode prefix and the get the data for that field by pulling substrings from the full postcode.

    AND
    if you want this to happen automatically for USER in role A, (ie automatically only show users relevant to them) then you have additional logic that you need to have happen.

    Honestly short of writing a whole separate app it might be worthwhile seeing if you could influence the wp user query and have the main wp userlist filter on your custom code.

    There is this add-on https://wpusersplugin.com/downloads/users-like-me/ that is ‘close’ but does not work on sub part of fields.

    Thread Starter aliferis

    (@aliferis)

    thanks
    could I adapt the user-like-me addon to user a sub string of a field ?

    Joe

    Plugin Author anmari

    (@anmari)

    Well, yes but best way would be to do options suggested above.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter with partial values or wildcards’ is closed to new replies.