Last active
August 25, 2020 19:09
-
-
Save scottopolis/0711275deb2a62fd7278aed829a104b1 to your computer and use it in GitHub Desktop.
Filter AppPresser login data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// when a user logs in, get WordPress data that can be used in the app, for example a membership level | |
// put this code in a custom plugin | |
add_filter( 'appp_login_data', 'apppresser_filter_login_data', 10, 2 ); | |
function apppresser_filter_login_data( $login_data, $user_id ) { | |
$member_subscription = rcp_get_subscription_id( $user_id ); | |
if( $member_subscription ) { | |
$login_data['membership_level'] = $member_subscription; | |
} | |
return $login_data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment