Feature request: native support for querying custom database tables in Dynamic Content

One area that still requires custom code (often via the Dynamic Content API) is accessing data stored in custom database tables created by other plugins or custom solutions.

Would it be possible to add native support inside Dynamic Content for safely querying custom tables?

Perhaps under a new “Database” or “Custom Table” group in the Dynamic Content picker (similar to Post, User, ACF, etc.) with options to:

  • Select a table (only tables with the WP prefix or explicitly whitelisted)
  • Choose columns/fields
  • Add simple WHERE conditions (using existing Dynamic Content tokens for values, current post ID, user ID, etc.)
  • Support for basic joins if multiple tables are involved. Many plugins spread related data across multiple custom tables. Without joins, you can only pull data from one table at a time, which would be limiting.
  • Return single values, arrays, or objects that can be used with Loopers and such.

Many popular plugins store their core data in custom tables for performance or structure reasons (instead of in postmeta or options). Examples include:

  • Booking / reservation systems
  • Event calendars with complex schedules
  • Membership or LMS plugins
  • Analytics or logging plugins
  • E-commerce or directory plugins
  • Inventory management tools

Right now custom solutions are needed with custom code, which is a barrier for a lot of users.

This would make Cornerstone feel even more like a true web application builder, giving even more power and flexibility to non-developers (and speeding up developers)

I would absolutely love to see this in a future update.