Okay
  Public Ticket #951542
tables from custom post types & custom tables
Closed

Comments

  •  2
    ndic started the conversation

    I'm trying to generate a datatable from a custom post type, custom taxonomy and custom fields that I created with CPT UI and ACF. When I use the wpDataTable Constructor, I can select the custom post type and custom taxonomy I created but the custom fields associated with that do not display. Is it possible to select the custom fields or is creating a custom sql query the only way to pull the custom fields into my datatable? 

  • [deleted] replied

    Hi Ndic,

    I didn't have opportunity to work with those plugins so,  to be able to help you, I'll need temporary credentials for both your website as sell as phpMyAdmin.  

  •  2
    ndic replied

    Seriously? ACF (Advanced Custom Fields) is the most popular plugin for creating custom fields with over 1 MILLION downloads from WordPress. CPT UI is just a user interface for creating new custom post types and taxonomies. I can not give access to the site because it is behind a VPN and firewall. 

    Does it really matter HOW I create the taxonomies or custom fields?  The real question is, will wpDataTables work with custom post types and custom fields? 

  • [deleted] replied

    Hi ndic,

    Easiest way to create table from custom fields and taxonomies is trough Table Constructor. You can choose option 

    "I want to create a table based on my WordPress data (posts or pages, and post meta or taxonomy values)"

    You can find more information about this in our - Text documentation - Video tutorial

  •  2
    ndic replied

    Yes, I did that and it sees the custom post type and the associated taxonomy but it does not list any of the custom fields that are associated with the custom post type. 

    Note the custom post type "Servers" shown in this screenshot, which contains custom fields like "Server IP" and "OS":

    screenshot 1

    Now, see the Table Creation Wizard screenshot below. In this screenshot, I have selected my custom post type, however when I try to select the "posts properties" that I want as table columns, none of my custom fields are available to be selected from this menu.

    screenshot 2

    Is there any way to get my custom fields to appear in this second menu so I can choose them as columns in the resulting table?


    Thanks,
    Masen


  • [deleted] replied

    Hi ndic,

    I installed both plugins to test this and created real simple setup as you can see in the attachments. First three attachments are from CPT UI and fourth is from Custom Fields. Because I cannot upload more files I will split my answer into two


  • [deleted] replied

    In final two screenshots you can see custom post type along with custom field as well as resulting table showing data. Could you please tell me in which part your setup is different then mine so I can try to recreate it and test. 

    If you can record screencast in which you can show me how you created your setup that would be really helpful

  •   ndic replied privately
  • [deleted] replied

    Hi ndic,

    For some reason I have all the meta in post as you can see in the attachments. I created and left table named wpDT Support created from Table Constructor. I didn't make any changes, just chose third option from constructor and then "server" as post type.

    Please try again and if you still don't see meta we will investigate this further