PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Accessing custom values + custom registration on signup

s2Member Plugin. A Membership plugin for WordPress®.

Accessing custom values + custom registration on signup

Postby 21inspired » September 7th, 2011, 4:19 am

We want to access custom values (CV1 etc.) and custom registration fields programmatically when a user registers on the site.

Is the ws_plugin__s2member_during_configure_user_registration hook the best place to do this?

What index do I need into the vars array to access:

1. The CV values (is it just $vars['cv1']) ?
2. Custom registration fields (is it just $vars['fieldID]?

Thanks, Roger
User avatar
21inspired
Registered User
Registered User
 
Posts: 12
Joined: October 14, 2010

Re: Accessing custom values + custom registration on signup

Postby Jason Caldwell » September 9th, 2011, 7:01 pm

Hi Roger. Yes, you've almost got it. Here's a code sample for you.
Code: Select all
<?php
add_action 
("ws_plugin__s2member_during_configure_user_registration", "my_function");
function my_function ($vars = array ())
    {
        $cv1 = $vars["cv"][1];
        print_r($vars); // for a full list during tests.
    }
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Accessing custom values + custom registration on signup

Postby 21inspired » September 10th, 2011, 9:09 am

Hi Jason,

thanks for the feedback... I was quick hacking on a live site, so didn't want to print_r. We have a test environment in place now, so will do that.

It's part of a workflow where we want to redirect to different pages (and do some processing - vote counting) depending on the route they took to initiate their registration.

Cheers, Roger
User avatar
21inspired
Registered User
Registered User
 
Posts: 12
Joined: October 14, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron