1

I'm using memberpress for my application, and I want to be able to get all user subscriptions in an array or object so I can manually loop them, among other functions.

I cannot, for the life of me, find any developer documentation that isn't REST API or shortcode based.

Does anyone know where I can find documentation on how to use memberpress in custom templates?

2 Answers 2

2

I know it was asked a long time ago. But just a tip for others who see this.

You can use global $wpdb in any wordpress file to access the pre-defined class. If you know sql you can create a custom query to find active or inactive memberships from one of the memberpress tables.

For reaccuring memberships: $wpdb->prefix.'mepr_subscriptions'

For non-reaccuring: The table is $wpdb->prefix.'mepr_transactions'. It has all the past and current transactions for every user, so you would have to ensure your query only grabs the most current one.

You should consider staging the site and using phpmyadmin to set up the query.

goodluck.

0

I've also struggled with this in 2024. The best resource I've found is this archived git repo, with the code in.

https://github.com/wp-premium/memberpress-developer/blob/ed2d65ee4d1cdcef6b09223beb5774809fd9a20b/app/models/MeprUser.php

I've linked to the MeprUser class because that's where you can find functions like full_address() and custom_profile_fields().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.