Custom Director with hidden filter of user meta field

BP Profile Search › Custom Director with hidden filter of user meta field

  • Author
    Post
  • #9952 Reply
    JG
    Guest

    Hi there!

    I have a user_meta field that is set by a separate process (MemberPress) during registration and would like to be able to filter on this field in a custom directory to only show users in a certain Membership. As far as I can tell, BP Profile search does search on user meta, but I don’t see a way to filter on a user meta key (or value) in the custom directory shortcode. I’d like to do something like:

    [bps_directory field_34=”greatValue”]

    Where field_34 is a meta_key in the usermeta table, and “greatValue” is a value in the usermeta table.

    #9953 Reply
    andrea
    Plugin Author

    Hello JG,

    First you have to add your user_meta field to the BP Profile Search list, see:

    https://dontdream.it/bp-profile-search-4-8-4/

    Then you can create your custom directory using the actual meta_key name of your field:

    [bps_directory my_user_meta_key="greatValue"]

    #9954 Reply
    JG
    Guest

    Oh wow, that’s awesome; it’s works extremely well! Thanks so much for the quick response and helpful post!

    Have a great day!

    #9956 Reply
    andrea
    Plugin Author

    You’re welcome, a great day to you too!

Reply to: Custom Director with hidden filter of user meta field
My Information