latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Facebook integration advice

Home Forums Community Forum Facebook integration advice

This topic contains 2 replies, has 3 voices. Last updated by  Jason (Lead Developer) 4 years, 7 months ago.

Topic Author Topic
Posted: Wednesday May 23rd, 2012 at 5:05 pm #14363

We’re looking to integrate the login/registration process for our site with Facebook’s API. We want to give users the option to register to the site with their Facebook credentials instead of entering a new email, etc. I’ve seen a number of WP plugins which claim to provide this functionality, but the few I’ve experimented with don’t seem to play nice with s2Member.

I’m leaning in the direction of writing my own plugin/hack but I wanted to consult you first. I’m hoping you can point me in the right direction… either how to hook into the s2Member registration routine, OR possibly sidestepping it all together. Any input you can give me would be greatly appreciated.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Thursday May 24th, 2012 at 4:55 am #14442
Raam Dev
Username: Raam
Staff Member

Hi Brett,

I will forward your question along to the lead developer, but I know he’s quite busy working on the next major release of the plugin.

Posted: Thursday May 24th, 2012 at 6:19 am #14456
Staff Member

Hi there. Thanks for the heads up on this request for support.

Regarding Facebook. Yes, I would just sidestep s2Member in any custom integration that you do. From my experience with Facebook, it’s best to create a Free Subscriber account within WordPress, based on the data provided by the Facebook API. This allows the potential customer into the site with a Username/Password.

Once logged in, if they buy something, s2Member will automatically upgrade their existing Free Subscriber account within WordPress, to a paid Membership Level.

So for instance, you might use this WordPress function, in concert with your Facebook integration.
http://codex.wordpress.org/Function_Reference/wp_create_user

The default Role in WordPress, is the “subscriber” Role. So wp_create_user() should be the only function call you need to complete the integration with Facebook. If you need to make adjustments after creating the User. You might do something like this.

<?php
$user_id = wp_create_user(username, password, email);
$user = new WP_User($user_id);
$user->set_role('s2member_level1'); // Give them paid Membership access for free?
$user->set_role('subscriber'); // Take it away?
?>
Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.