Search for Members by Custom Profile Fields
Do custom profile fields get stored in the database as meta fields on the user? I'm wondering if using it's possible to create a WP User Query or call get_users to return a list filtered on some custom profile fields. Or is there a way to add custom Status beyond Active | Pending | Blocked?
Waiting for this as well π
https://community.wpmanageninja.com/portal/post/introducing-fluentcommunity-2-3-0-and?comment_id=50770
Bess Siegal Custom profile field values are stored as JSON in the custom_fields column of FluentCommunityβs {prefix}fcom_xprofile table. They are not stored in WordPress user meta, so a standard meta_query in WP_User_Query or get_users() cannot filter them directly.
With custom code, you can query FluentCommunityβs profile table for matching user IDs, then pass those IDs to get_users() using the include parameter.
Custom member statuses beyond Active, Pending, and Blocked are currently not supported. If you need an additional classification, you could use a custom profile field, but it would not control member access like the built-in statuses.
Syed NumanΒ thank you for your reply
Related question: From Fluent Forms Pro, using the Fluent Community Integration or a hook/code snippet, is there a way to update the Fluent Community Member's Custom Profile Fields from a Fluent Form submission?
I know how to add an action to save Fluent Form values to custom User Meta Fields. So that the same values appear in the Community Member's Custom Profile Fields, is there a code snippet to write values to the currently logged in member who fills out a Fluent Form?
Bess SiegalΒ Yes, this can be done through a custom PHP snippet using Fluent Formsβ fluentform/submission_inserted hook.
The snippet would identify the logged-in member, map the submitted form values to the corresponding Fluent Community custom profile fields, and save them to that memberβs Community profile.
This is necessary because Community custom profile fields are stored separately from WordPress user meta. Saving values to user meta wonβt populate them, and the built-in integration doesnβt currently support this mapping.
Syed NumanΒ https://dev.fluentcommunity.co/database/models/x-profile does not include custom_fields attribute. Is this where I would access it in code (the doc not yet updated)? Thank you again!!