Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

[wp_eMember_upgrade_membership_level_to] shortcode does not change wp role

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › [wp_eMember_upgrade_membership_level_to] shortcode does not change wp role

  • This topic has 6 replies, 2 voices, and was last updated 12 years, 10 months ago by admin.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • September 3, 2012 at 2:44 am #7301
    gmangesh
    Member

    Hello,

    I have two eMember Levels – lets say “Gold” and “Silver”.

    These are associated with two WordPress role “WP Gold” and WP Silver” respectively.

    WordPress Integration is ENABLED.

    The association with the WordPress roles is used to drive access to Forums in SimplePress – so it is important that the eMember roles stay in sync with WordPress roles.

    I have “Enable Secondary Membership:” enabled – but the behavior described below is the same regardless of this setting.

    If I switch a users Primary role from the Edit Members screen in eMember, then the user’s WordPress role also gets correctly modified to stay in sync with the eMember membership level.

    However, I also have an upgrade button created using the [wp_eMember_upgrade_membership_level_to level=x] shortcode. And if the user clicks on this upgrade button, then the user’s Primary eMember role gets switched – but his WordPress role does not get switched. This results in the the WordPress roles getting out of sync with eMember roles.

    The code for this shortcode confirms the observed behavior – the wp_eMember_upgrade_membership_level_to_handler() function only updates the eMember membershiop table – it does not modify WordPress roles of the user.

    Keeping the roles in sync is important for me – is it possible to get a fix for this?

    Thanks

    September 4, 2012 at 6:15 am #48900
    admin
    Keymaster

    I have fixed this shortcode in the eMember plugin code.

    September 4, 2012 at 6:20 pm #48901
    gmangesh
    Member

    Thanks for the rapid response!

    I’ll try out the new version

    September 5, 2012 at 6:13 pm #48902
    gmangesh
    Member

    Hi,

    I get the following error when I click on the “Upgrade” button generated by the [wp_eMember_upgrade_membership_level_to level=x] shortcode:

    Fatal error: Call to undefined function emember_debug_log_subsc() in /home/xxx/public_html/xxx/wp-content/plugins/wp-eMember/eMember_misc_functions.php on line 635

    (eMember_debug_log_subsc() is defined in ipn/eMember_handle_subsc_ipn_stand_alone.php)

    September 5, 2012 at 6:31 pm #48903
    gmangesh
    Member

    To test the rest of the functionality I temporarily commented out the offending function call.

    Now, the WordPress role is getting updated.

    HOWEVER, the SimplePress role does not get updated.

    I am guessing some hook is not getting triggered.

    September 5, 2012 at 6:44 pm #48904
    gmangesh
    Member

    Ok, found the hook.

    The “set_user_role” hook needs to be invoked.

    Add the following line after the call to “update_wp_user_Role()”

    do_action( ‘set_user_role’, $user_info->ID, $role_name );

    ( And comment out the call to eMember_debug_log_subsc() to fix the PHP error )

    Thanks

    September 6, 2012 at 2:50 am #48905
    admin
    Keymaster

    Thank you. I have corrected this issue in the plugin.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ