Support

Account

Home Forums ACF PRO ACF Pro & wpdatatables

Solving

ACF Pro & wpdatatables

  • I am using ACF Pro to add fields to custom post types. I want to tabulate a filterable list of posts and am using wpdatatables to do this. The problem is that multi select option fields such as Drop Down and Check Box are stored as an array. When I query the data using wpdattables it just throws up the array like:

    a:2:{i:0;s:6:”Cheese”;i:1;s:10:”Ham”;}

    whereas I want a comma separated list of selections like:

    Cheese, Ham

    I am just wondering the best way to achieve this with wpdatatables.

    Thanks

  • You would need to talk to support for the other plugin and see if they provide any way to filter what is shown. It appears that they do provide filters and action hooks https://wpdatatables.com/documentation/information-for-developers/filters/

    If they do not then you need to store the data differently for what the other plugin needs. This can be done by adding an acf/save_post action. In this action you get the ACF field values and store them in a standard WP custom meta field, using a different field name, so that they other plugin can use it. I explain the basics of doing this here https://acfextras.com/dont-query-repeaters/. This specifically references repeaters, but the same thing can be done with any ACF field type that does not store values in the standard WP way.

    The first option would likely be easier.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘ACF Pro & wpdatatables’ is closed to new replies.