This topic has 6 replies, 2 voices, and was last updated 10 years by infinitelinx.
-
Author
-
June 6, 2014 at 23:24 #19436infinitelinxParticipant
After someone registers, how can their membership level automatically be set to a specific one? I have a FREE membership level that expires after 14 days. How do I set new registered users to that level the moment they register?
Thank you.
June 7, 2014 at 08:44 #19465AnchoraParticipantas provided earlier:
COPY CODEadd_action('user_register', 'kleo_pmpro_default_level'); function kleo_pmpro_default_level($user_id) { pmpro_changeMembershipLevel(9,$user_id); }
where “9” is the default-level, in this case.
but remember that this snippet will kill the registrationprocess, if pmpro is DEactivated.
June 9, 2014 at 17:02 #19547infinitelinxParticipantHi there,
Where do I enter that code? Also, PMPRO is activated.
Julie
June 9, 2014 at 17:17 #19555infinitelinxParticipantI entered the following in sweet-child/functions.php and changed 9 to 1 because that is the ID for the FREE membership level setup in PMPRO. When I do this and try to log out of WP so I can register and test it out, I get the attached error. Also, you stated “as provided earlier:” however, I don’t see anything about that in the SweetDate documentation. Thank you.
<?php
/**
* @package WordPress
* @subpackage Sweetdate
* @author SeventhQueen <themesupport@seventhqueen.com>
* @since Sweetdate 1.0
*//**
* Sweetdate Child Theme Functions
* Add extra code or replace existing functions
*/add_action(‘user_register’, ‘kleo_pmpro_default_level’);
function kleo_pmpro_default_level($user_id) {
pmpro_changeMembershipLevel(1,$user_id);
}?>
Attachments:
You must be logged in to view attached files.June 9, 2014 at 17:28 #19557AnchoraParticipantit’s not in the documentation, but a sticky thread in the forum:
https://archived.seventhqueen.com/forums/topic/membership-auto-in-registrationwith “headers alredy sent” I would have a look for spaces before the <?php …
can’t tell you exactly.
but abe surely will.
🙂June 9, 2014 at 17:41 #19559infinitelinxParticipantOk, I clicked on that thread and copied his code and it worked. It looks like the exact same code but I think some characters were converted by email so I copied and pasted the wrong one. Thanks. This seems to work now.
-
AuthorPosts
The topic ‘Registration’ is closed to new replies.