-
Author
-
October 27, 2014 at 06:29 #33145wielandsmithParticipant
Is there a way that when someone registers for buddypress, the site asks them to subscribe? What is the best way to set something like this up?
October 27, 2014 at 19:26 #33168wielandsmithParticipantor what I mean is… someone signs up via facebook… and they’re automatically subscribed to a specific membership level (the free one) as well as registered on the forums? I just want everything tied together.
Also, the facebook login still isn’t working..
Thank you,
MonicaOctober 30, 2014 at 11:45 #33597AbeKeymasterHello, right now users need to register first and then apply for a membership. We will try to optimize the process in the future. You can assign a level at registration like this :
This is the function you need to add in order to assign a specific membership level to a newly registered user. Add it into your sweetdate-child/functions.php
COPY CODEadd_action('user_register', 'kleo_pmpro_default_level'); function kleo_pmpro_default_level($user_id) { pmpro_changeMembershipLevel(1,$user_id); }
This one assigns level with ID 1
Also this code checks for a specific profile value and add only those users to the membership level. Does not apply with Facebook registration
COPY CODE/** * When registering, add the member to a specific membership level * based on the field value he has selected * * @global object $wpdb * @global object $bp * @param integer $user_id */ function kleo_pmpro_default_level($user_id) { global $wpdb, $bp; //Change this with your field name $field_name= "I am a"; //Change the field value $value_to_match = "Woman"; //Membership level id $membership_level = 1; //Done editing $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) ); if ($_POST['field_'.$field_id] == $value_to_match) { pmpro_changeMembershipLevel($membership_level, $user_id); } } function kleo_mu_pmpro_default_level($user_id, $password, $meta) { global $bp, $wpdb; //Change this with your field name $field_name= "I am a"; //Change the field value $value_to_match = "Woman"; //Membership level id $membership_level = 1; //Done editing $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) ); $field_value = $meta['field_'.$field_id]; if ( $field_value == $value_to_match ) { pmpro_changeMembershipLevel($membership_level, $user_id); } } if (is_multisite()) { add_action( 'wpmu_activate_user', 'kleo_mu_pmpro_default_level', 10, 3); } else { add_action('user_register', 'kleo_pmpro_default_level'); }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.November 6, 2014 at 00:31 #34264wielandsmithParticipantI’d like to try it – but for some reason, everything disappears when I activate the kleo child theme. it’s strange. I’ll keep playing with it.
November 10, 2014 at 17:46 #34903AbeKeymaster@wielandsmith you should read what they do and add whichever suits your needs
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.November 12, 2014 at 14:41 #35192AbeKeymasteryour child theme must be active for that to work and your level id should be changed from 1 to match yours
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.December 3, 2014 at 12:53 #37458AbeKeymasterAre you registering via Facebook?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.December 3, 2014 at 16:21 #37501wielandsmithParticipantHonestly, I might as well just cut out the basic level since it’s free and switch it to “logged in” … that way I don’t have to worry about a default membership.
December 3, 2014 at 17:56 #37522AbeKeymasteryes there is no point of having a free level
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 18, 2015 at 23:26 #42556mlennox10Participant@abe and wielandsmith
I too have a free level of membership, can you restrict content with a ‘logged in’ setting? If so, where is that setting please?
Also, I’ve activated the child theme however I’m working from the main theme in terms of dashboard etc. Is that the right way?
All help and advice appreciated.
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.