Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics

Use an SQL query in a custom field


I use your plugin (Admin Columns) on my website and it functions well.

Today, I would like to gather information from another plugin : PaidMembershipPro.
This information is stored in the database “pmpro_memberships_users” and is called “endate”.

I can view this one in the database, like in this picture below.

How can I create a custom field with an SQL query to access to this information?

This field is not suggested in the drop-down “champ” when I add a Custom Field, like in this picture below:

Thank you for your attention.


5 years, 2 months ago
Stefan van den Dungen Gronovius


In your case, I advise writing your own column instead if trying to manipulate the custom field column. Because technically, you’re not working with a ‘custom field’ if it is not stored in the post_meta table.

We do have some documentation and even a toolkit to get you started writing your own column.
This way, you have full control of how your new column behaves and even write your own logic for sorting/filtering and editing support.

You could write a column for each field you like to display, or if you want to dive into our code, you could create a setting as we did in our custom field column to select which field you want to display. Of course, this approach would require some better understanding of both our API and the API of PaidMembershipPro. So starting with a column for each field would probably the fastest way for you to start.

5 years, 2 months ago

You must be logged in to reply to this topic.