Skip to content

Instantly share code, notes, and snippets.

@scottopolis
Last active August 25, 2020 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottopolis/0711275deb2a62fd7278aed829a104b1 to your computer and use it in GitHub Desktop.
Save scottopolis/0711275deb2a62fd7278aed829a104b1 to your computer and use it in GitHub Desktop.
Filter AppPresser login data
<?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