Skip to main content

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?

Syed Numan

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.

Bess Siegal

Syed NumanΒ thank you for your reply

Bess Siegal

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?

Syed Numan

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.

Bess Siegal

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!!