Discover in this tutorial how to add a column showing Easy Digital Downloads subscription status in the WordPress user panel using code.
If you have a membership site created with Easy Digital Downloads (plus the Recurring Payments and Content Restriction addon) it is likely that more than once you have wanted to view the status of a user from the general user page.
Being able to view it from the users section, without having to access the customer file, can be very practical and save you time.
The good news is that with a little bit of code you can achieve this:
Let’s see how:
Snippet to add a column to display EDD subscription status on WordPress user page
Add the following code at the end of functions.php or in your functionality plugin:
With this snippet you use the
manage_users_custom_column filters to add the new column (EDD status) and display the user’s subscription status.
You also use the
EDD_Recurring_Subscriber class to get the subscription data and extract the information about the user’s subscription status.
In the example, it only looks at the subscription with ID=21 but you can modify it or use 0 if you prefer to take into account all the existing subscription levels on the web.
Also, you tell it to display “No subscription” (you can change it to whatever you prefer) if the user does not have any subscription created.
Finally, you can change the “EDD status” text to whatever you want (“Subscription status”…).
Now you know how to display Easy Digital Downloads subscription status on WordPress users with a little bit of code.
If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.
Benefits of being a subscriber. 🙂