All Custom Fields of a user

Hi,

I want to list all custom fields of my members using PHP. My idea is following:
$members = get_users();
foreach ($members as $member) {
$user_id = $member->ID;
$array = S2_FUNCTION_X ($user_id);
publish ($array); // my printfunction per member
}

My current solution is that I pick up the fields for a user ‘field-by-field’ with the get_user_field function but this gives a read action per field per user, so takes a lot of performance.
Anyone an idea for an S2 function I could use?

If you need info about custom fields, this will extract all of them as array of objects:

$custom_fields = json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]);

If you need the value of each custom file for each member, you may do a MySQL query to read all of them from the “usermeta” table and then parse result to find what you need.

Hi Krum,

Thnx. I will implement tomorrow!!

Best regards,
Leon