admin管理员组

文章数量:1122846

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?

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?

Share Improve this question asked May 6, 2019 at 16:58 S_RS_R 1635 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 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.

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().

本文标签: pluginsMemberpress functionsdocumentation