Hi Nik,
You can use the plugin to create and alter database tables. Not sure what you mean with custom fields, but custom fields as in custom post types are not supported with WP Data Access.
Does this answer your question?
Thanks,
Peter
Hi Peter,
WooCommerce Subscriptions has a whole lot of fields it creates like _schedule_next_payment
and I have created my own custom usermeta fields like _my_custom_field
that exist in subscription post meta. Can I create a table out of these types of fields or is that classed as CPT fields?
Thanks
Nik
Hi Nik,
I think you can create a table or view for your CPT, but my knowledge of CPT is too limited to tell you how. A view would be even better, as it allows you to maintain your CPT and use the output in ohther tools like the Data Publisher. Not sure if this will be usable for large amounts of data. How many rows and custom columns does your table have?
Who can help to write a view to query CPT?
Thanks,
Peter
Hi Nik,
I couldn’t resist searching for a CPT solution! 🙈 Please check this page to learn how to write a query using CPT:
https://stackoverflow.com/questions/15169010/sql-query-for-custom-post-type-and-multiple-custom-fields
With my limited knowledge of CPT I presume the last post from Miguel should be the correct one. He is adding a join for each custom field. This is why your query might get slow if you have too many custom field (= joins) and/or to many rows.
Once you have your query working, you can use it to create a view and use your view in WP Data Access. I’m also working on direct query support for the Data Publisher, but that will be a premium feature.
Will you please let me know if you find a solution? Maybe I should add support for CPT to WP Data Access…? 🙂
Best regards,
Peter