Page 1 of 1

Custom Fields in usermeta Table

PostPosted: January 3rd, 2011, 1:14 pm
by nfavari84
Hi everyone!

As of now the s2member custom fields get saved as a single, serialized array in the wp_s2member_custom_fields usermeta.
First of all: why is that so?

Then the problem is this:
how do I filter my users based on a s2Member custom field (like "province")?

If it was a simple usermeta field, I could have used a straightforward query like this one:
Code: Select all
$wp_user_search = $wpdb->get_results("
SELECT u.ID, u.display_name, um.meta_value
FROM $wpdb->users u
JOIN $wpdb->usermeta um ON um.user_id = u.ID
WHERE um.meta_key = 'province'
AND um.meta_value = 'value'
");


Given I can't, what's the fastest solution available?

(a "this feature is planned" response is very welcome, of course, but I need a viable solution with the stuff I have at present).

btw Happy new year everybody!
:D

edit: I'm also open to intercepting fields and creating usermeta during the signup process, but what's the exact hook? is there a hook that fires after a successful user registration?

Re: Custom Fields in usermeta Table

PostPosted: February 23rd, 2011, 12:29 pm
by Jwrbloom
Did you make any progress on this issue? I'm in the same boat as you are.

Re: Custom Fields in usermeta Table

PostPosted: February 23rd, 2011, 10:06 pm
by Cristián Lávaque
Maybe you'll need to create a new table where to store that data to do what you want. I have no idea how to create a WP plugin, otherwise I'd be happy to help.

I'd also store all the data that modifies access to content to manage drips simpler.

Re: Custom Fields in usermeta Table

PostPosted: April 19th, 2011, 4:48 pm
by dwbiz05
Tables are always better in my opinion, but this might be an option, at least it's working for me at the moment.

viewtopic.php?f=4&t=1668&p=12950#p12950

D.