Page 1 of 1

User registration via WordPress API on non-multisite

PostPosted: January 29th, 2012, 6:25 pm
by durge
I am using the s2member-pro plugin to subscribe users to my website as a paid service and I am also using a plugin called subscribe2 which sends out daily emails of all the new posts. In the subscribe2 plugin, they have an option to auto-subscribe new users which I have enabled; however, it is not auto-subscribing new users.

I spoke with the developer of the plugin and he said that he did a quick look through of the s2member code and he said that the 'user_register' hook is never fired when users are created via the plugin on non-multisite configurations of WordPress and the comments in the code says that you are considering alternative ways of registering users through the WordPress API.

Is there any fixes that you might be able to recommend that I can try out to get this working?

Thanks!

Re: User registration via WordPress API on non-multisite

PostPosted: February 6th, 2012, 2:40 pm
by Jason Caldwell
Thanks for your inquiry.

Hmm, I'm not sure which comments they are referring to exactly. I can confirm though, s2Member does already make full use of the WordPress API for user registration, and the user_register Hook is what powers most of the s2Member registration process (i.e. this Hook is definitely fired each time a user/member/customer registers).

See file: /s2member/includes/classes/registrations.inc.php
Code: Select all
/**
                * Configures all new Users.
                *
                * The Hook `user_register` is also fired by calling:
                * ``c_ws_plugin__s2member_registrations::ms_create_existing_user()`` and/or ``wpmu_create_user()``.
                *
                * This function also receives hand-offs from s2Member's handlers for these two Hooks:
                * `wpmu_activate_user` and `wpmu_activate_blog`.
                *
                * @package s2Member\Registrations
                * @since 3.5
                *
                * @attaches-to ``add_action("user_register");``
                *
                * @param int|str $user_id A numeric WordPress® User ID.
                * @param str $password Optional in most cases. A User's plain text Password. If unspecified, attempts are made to collect the plain text Password from other sources.
                * @param array $meta Optional in most cases. Defaults to false. An array of meta data for a User/Member.
                * @return null No return value. Returns `null` in possible every scenario.
                *
                * @todo Impossible to delete cookies when fired inside: `/wp-activate.php`?
                */
                public static function configure_user_registration ($user_id = FALSE, $password = FALSE, $meta = FALSE)