acf-builder icon indicating copy to clipboard operation
acf-builder copied to clipboard

How to implement an ACF add on plugin like "Advanced Custom Fields: Table Field"?

Open ferremek opened this issue 6 years ago • 3 comments

Hi guys,

Since the day I got into the acf-builder I never looked back, it is awesome and changed the way I do WP development!

A client of mine has a lot of tables in their website and I would like the add on plugin Advanced Custom Fields: Table Field for it, this seems perfect. How do I approach adding in an external add-on plugin in acf-builder? Is it possible in any way?

Thanks in advance!

ferremek avatar Oct 24 '19 05:10 ferremek

@ferremek ... If you have the Table Field installed. It should be something like this:

TablePress Table

$attributes = [
    'allow_null' => 0,
    'return_format' => 'table_id' || 'rendered_html'
];
$group->addField('my_field_name', 'tablepress_field', $attributes);

This code above is for a similar plugin called tablepress. But check the source code of the table field plugin and adjust accordingly.

DalkMania avatar Nov 18 '19 16:11 DalkMania

this is so fucking amazing, worked like a charm

eballeste avatar Mar 28 '20 21:03 eballeste

I struggled getting "Advanced Custom Fields: Table Field" to work using Acf-Builder Nothing showed up in admin, but all debugging indicated it loaded properly.

ACF 5 Pro - Version 6.0.7 Advanced Custom Fields: Table Field - Version 1.3.20

But adding the "type" prop made it work :-)

$attributes = [
      'type' => 'table', // important
      'use_header' => 1,
      'use_caption' => 1
  ];
$group->addField('my_field_name', 'jh_acf_field_table', $attributes )

mjatzgit avatar Feb 21 '23 08:02 mjatzgit