• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Store
    • Cart
    • Checkout
  • Blog
    • Basics [Free]
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Contact
  • Sign In
  • Show Search
Hide Search
Home » Actions » Set user forum access when using bbPress with the PayPal subscription extension

Set user forum access when using bbPress with the PayPal subscription extension

Chad Butler · Nov 2, 2014 ·

People have asked how I manage user forum access when using the PayPal subscription extension.  Here is how I do it on this site.  

This article is only available to WP-Members Support Subscribers. If you have an existing subscription, please login below. If you do not have a current support subscription, you can purchase a support subscription here.

Already a Member? Log In Here
   
Forgot password? Click here to reset

To gain full access to WP-Members premium content, a current support subscription is required. You can purchase an annual support subscription for as little as $59, which provides you with access to priority support, a customer support forum, access to code snippets, and more.

Why wait? Choose your subscription option here.

[
Why join?]

Actions actions, add_action, paypal, wpmem_exp_after_set_exp

Welcome to RocketGeek Interactive › Forums › Set user forum access when using bbPress with the PayPal subscription extension

Tagged: actions, add_action, bbpress, PayPal, wpmem_exp_after_set_exp, wpmem_set_user_bbp_role

  • This topic has 4 replies, 2 voices, and was last updated 6 years, 1 month ago by Chad Butler.
Viewing 2 reply threads
  • Author
    Posts
    • November 2, 2014 at 7:05 pm #6307
      Chad Butler
      Keymaster

      People have asked how I manage user forum access when using the PayPal subscription extension.  Here is how I do it on this site.   I currently keep t
      [See the full post at: Set user forum access when using bbPress with the PayPal subscription extension]

    • January 4, 2015 at 10:46 pm #6684
      JoeDostie
      Participant

      Hello Chad,

      New subscriber to your site and so far it has been a fantastic product and I am really learning a ton!

      So from what I can gather reading these directions. I have a web site where everything is free (no charge) its just the user needs to sign up and become a member (via WP-members) and my goal is to have a new User become a “generic” level person and they will have access to comment. I have that working perfectly.

      My next step is to have them automatically get the “Participant” role assigned to them in the bbPress forum role.

      I suspect that is accomplished with the same code as above but using the wpmem_post_register_data action (as follows):


      add_action( 'wpmem_post_register_data', 'wpmem_set_user_bbp_role', 10, 2 );
      function wpmem_set_user_bbp_role( $user_id, $renew ) {
      if( $renew ) {
      bbp_set_user_role( $user_id, 'bbp_participant' );
      }
      return;
      }

      I dont want any of my admins to have to assign the bbPress role, just to Activate the user.

      My only issue is I cant get the action to populate. Its most likely I am using the wrong, the $renew is throwing me off…

      Any help is appreciated!

      Thanks,
      Joe Dostie

      • January 5, 2015 at 10:50 am #6687
        Chad Butler
        Keymaster

        Thanks for the post – sounds you like you are getting along quite well with the plugin.

        It sounds like you are not using the PayPal extension? If not, you are pretty close to what you need in that filter – the logical test for $renew needs to come out. All you need is this:

        add_action( 'wpmem_post_register_data', 'wpmem_set_user_bbp_role' );
        function wpmem_set_user_bbp_role( $user_id ) {
        	bbp_set_user_role( $user_id, 'bbp_participant' );
        	return;
        }

        The snippet as given in the post was specific to the PayPal extension and enabling forum access once the user has paid.

        Hope that helps.

    • January 7, 2015 at 8:14 pm #6760
      JoeDostie
      Participant

      Thanks Chad,

      Works perfect! One thing I will mention incase anyone else uses this post, and I didn’t realize this myself until testing it a few times…

      Initially the Forum Role is NOT set when the user signs up for their account…

      The user will need to validate themselves and finish the registration process before the bbPress role is added to their account.

      I was using a fake account (fake@fake.com) to test the “flow” of the registration thinking it should set up everything ahead of time, but I guess it makes sense to set it after they are validated.

      Again, thanks so much for your help so far!

      • January 7, 2015 at 10:23 pm #6763
        Chad Butler
        Keymaster

        No problem – and thanks for the extra insights!

  • Author
    Posts
Viewing 2 reply threads
  • You must be logged in to reply to this topic.
Log In

Ready to get started?

Join Today!

© 2021 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Refund Policy