Select plugin version:
Shortcode
The WordPress shortcode allows you to insert tables into the WordPress editor content and into shortcode fields of Page Builders.
Parameters
[tablefieldpro field="" post_id="" table_class=""]
-
field=""
Simply the table field name. When the table field has parent fields then you can give the field name path like
parent_field_name/table_field_name
. You can use a field key or start a path with a field key, but the other items in the path must be field names.
-
subfield=""
For use of the shortcode in a ACF Repeater or Flexible Content field loop. When subfield is used,
field=""
gets obsolete. When the table field is a subfield then you can give the field name path likeparent_field_name/table_field_name
.
-
post_id=""
-
Defaults:
Defaults to
false
, which will use the current post. The post ID where the value is saved.
-
post-id="false" current post post-id="1" post ID = 1 post-id="user_2" user ID = 2 post-id="category_3" category term ID = 3 post-id="event_4" event (custom taxonomy) term ID = 4 post-id="option" options page post-id="options" same as above
-
table_class=""
A CSS class name used for the table HTML element.
Get table from current post, page or posttype
Shortcode
[tablefieldpro field=""]
Get table from another post
Shortcode
[tablefieldpro field="" post_id="123"]
Get table from option page.
Shortcode
[tablefieldpro field="" post_id="option"]
Get table if it has a parent field
Shortcode
[tablefieldpro field="parent_field_name/table_field_name"]
A parent field is usualy of type “Group” but can also a “Repeater” and “Flexible Content”. These can also be nested. See patterns below.
Get a table from a Repeater item
Shortcode
[tablefieldpro field="repeater_field_name/{item_index}/table_field_name"]
With this variant, a table field of a specific repeater entry can be output. The item_index
is a number corresponding to the repeater entry position starting at zero.
Get a table within a Repeater or Flexible Content field loop
Shortcode
[tablefieldpro subfield="table_field_name"]
Some page builders allow shortcodes to be used within an ACF Flexible Layout or Repeater item. Sometimes page builders provides also shortcodes for ACF Flexible Content and Repeaters. In this situation, this shortcode can output a table.
Pagebuilder Beaver Repeater example
[wpbb-acf-repeater name='my_repeater']
[tablefieldpro subfield="table_field_name"]
[/wpbb-acf-repeater]
Pagebuilder Beaver Flexible Content example
[wpbb-acf-flex name="my_flexible_content"]
[wpbb-acf-layout name="layout"]
[tablefieldpro subfield="table_field_name"]
[/wpbb-acf-layout]
[/wpbb-acf-flex]
Get tables from all items of a specific Flexible Content field layout
Shortcode
[tablefieldpro field="flexible_content_field_name/layout_name/table_field_name"]