ACF Table Field Pro Add-on Docs Last updated:

Release Candidate 1.8.0-RC1

This page documents version 1.8.0, which is available as Release Candidate 1.8.0-RC1 for manual installation. The current public version is 1.7.6, automatic plugin updates still deliver that version.

Download the Release Candidate from your account (Download the plugin) and install it manually (Install the plugin). Details may still change until the final release.

Version 1.8.0

Test the Release Candidate

We'd love your help testing 1.8.0-RC1 before the final release. Please test it on a staging site or a copy of your website first, and make a backup so you can go back to 1.7.6.

  1. Download the 1.8.0-RC1 zip from the files section of your order (Download the plugin).
  2. In WordPress go to Plugins → Add New Plugin → Upload Plugin and choose the zip.
  3. WordPress shows that the plugin is already installed. Click Replace current with uploaded. Your tables, settings and license key stay.

The final 1.8.0 will arrive through the normal plugin updates. A newer release candidate has to be installed manually again.

Found a bug or have feedback? Contact us on the support page and mention 1.8.0-RC1.

Table Field Pro 1.8.0 is coming soon. The headline of this release is cell formatting: alignment, font weight and size, italic, underline, uppercase, wrapping and tabular numbers, right in the table editor. The Table Manager is now officially released, and the table functions of the plugin are available as abilities of the WordPress Abilities API.

This release also brings a redesigned plugin settings page with a new Features tab, more control over the editor toolbar and the media button in the field settings, and a list of bug fixes.

Please read the breaking changes before you update.

Breaking changes

Before you update

Most sites need nothing and keep working as before. This release hardens the plugin (escaped output, checked AJAX requests, sanitized editor content) and makes some options stricter. The changes below can affect existing sites or code. Go through the ones that apply to you, and test the update on a staging site first.

The shortcode is off for new installs

Affects you if you set up a new site and use the shortcode [tablefieldpro]. Sites that used the plugin before keep the shortcode on. The setting is created on the first load after the update and is taken from the data the plugin stored before. Only a site whose plugin options were removed (for example by a cleanup plugin), or whose content was moved to a fresh install with the WordPress export and import, can end up with the shortcode off.

  1. After the update, open a page that uses the shortcode.
  2. If the table is gone, go to ACF → Table Field Pro → Features and switch on the shortcode.
  3. Or switch it on in code with the filter acf_tablefield/shortcode/enabled.

Read how to enable the shortcode →

The shortcode and the Table Manager escape the table output

Affects you if tables output with the shortcode, or with get_table() of the Table Manager, contain HTML that WordPress does not allow in post content, for example iframes (video embeds), scripts, style elements, SVG or form fields. In 1.7.6 both returned the table HTML as it was. Now the output goes through acf_esc_html() (or wp_kses_post() if ACF does not provide it), the same as the function get_table() always did, and this HTML is removed.

  1. Open the pages that show tables with the shortcode and look for missing embeds or scripts.
  2. If you need elements like SVG graphics, allow them with the snippet below. Add it to your theme (functions.php) or to a small plugin.

Allow SVG in the table output

add_filter( 'wp_kses_allowed_html', function( $tags, $context ) { 
 
	if ( in_array( $context, array( 'acf', 'post' ), true ) ) { 
 
		$tags['svg'] = array( 
			'xmlns'       => true, 
			'viewbox'     => true, 
			'width'       => true, 
			'height'      => true, 
			'fill'        => true, 
			'class'       => true, 
			'role'        => true, 
			'aria-hidden' => true, 
			'aria-label'  => true, 
			'focusable'   => true, 
		); 
 
		$tags['title'] = array(); 
 
		$tags['g'] = array( 
			'fill'      => true, 
			'transform' => true, 
		); 
 
		$tags['path'] = array( 
			'd'            => true, 
			'fill'         => true, 
			'stroke'       => true, 
			'stroke-width' => true, 
		); 
 
		$tags['circle'] = array( 
			'cx'     => true, 
			'cy'     => true, 
			'r'      => true, 
			'fill'   => true, 
			'stroke' => true, 
		); 
	} 
 
	return $tags; 
}, 10, 2 );

Add the SVG elements and attributes your graphics use. Write attribute names in lowercase, for example viewbox, because WordPress compares them in lowercase.

  • The snippet applies to the shortcode, to get_table() of the Table Manager and to the function get_table().
  • It uses the WordPress filter wp_kses_allowed_html and is global: it also allows the element in everything else on your site that is filtered with wp_kses_post() or acf_esc_html(). The context acf is needed because acf_esc_html() does not use the context post.
  • It also keeps the element when a table is saved, because the table content is filtered with wp_kses_post() on save.
  • An embed printed by a shortcode in a table cell is filtered as well, so the element must be allowed here too.

As a last resort, if the table content is trusted, you can turn the escaping off instead:

Only allow elements or turn the escaping off when only trusted users can edit the tables.

Read the Table Manager documentation →

The table editor removes unsafe HTML from cell content

Affects you if table cells hold HTML like iframes (video embeds), scripts or event attributes such as onclick. The editor cleans the stored cell content with DOMPurify when it shows it for the first time. Merely opening a table changes nothing in the database. But when someone changes the table and saves it, the cleaned content is saved and the removed HTML is gone.

  1. Before anyone edits a table with embeds or scripts, make a backup of the database.
  2. Open such a table in the editor and check that the content is still there.
  3. If you need an embed in a cell, you can use a shortcode of your theme or plugin in the cell instead, and let it print the embed. The editor then only holds the shortcode. For the output on the website the element must still be allowed, see the escaped table output.
  4. Developers can keep single elements in the editor with the filter sanitize_html (JavaScript). The new id cell_content_initial_render marks the first render. Load the snippet below in an admin script with the event tableFieldProRegisterHooks, see Admin script.

Keep SVG in the table editor

document.addEventListener( 'tableFieldProRegisterHooks', function() { 
 
	ACFTableFieldPro.core.addFilter( 'core', 'sanitize_html', function( options, param ) { 
 
		options.USE_PROFILES = Object.assign( {}, options.USE_PROFILES, { svg: true } ); 
 
		return options; 
	} ); 
} );

The editor only allows HTML elements. The snippet adds the SVG profile of DOMPurify and keeps the existing options. Scripts and event attributes inside the SVG are still removed.

The PHP snippet from the escaped table output is needed as well. Without it, the save (wp_kses_post()) and the escaped output on the website remove the SVG again.

AJAX requests of the editor are checked

Affects you if your pages with a table editor are fully cached, or if users without the capability upload_files edit tables in a front-end form (acf_form()). Every AJAX request of the editor now carries a security token (nonce) and is rejected with the status 403 if the token is missing or too old. The media button in the Editor content type is only shown to users who can upload files. Before, everyone got it. Logged-out users can open the editor in acf_form() now.

  1. Open a front-end form with a table field from the page cache. If the editor does not open and shows the message The security check failed, the cached token has expired.
  2. Exclude the pages with the form from the page cache.
  3. If users without upload rights need the media button, give them the capability upload_files.
  4. To require another capability for an AJAX request, use the filter acf_tablefield/ajax_capability.

The GraphQL mutation checks the user

Affects you if a client calls the mutation updateTablefieldPro without a user, or with a user who cannot edit the target. The user now needs the capability to edit the post, term, user or comment (or manage_options for other targets), and the selector must be a table field of that target. Otherwise the mutation fails with an error.

  1. Send the requests as a logged-in user with the right capabilities, for example with an application password.
  2. Check that the selector is the name or key of a table field.

Read the GraphQL documentation →

Toolbar and media button come from the Editor level

Affects you if a column, row or cell sets its own editor toolbar or media button, but its content type is Inherit. These values are ignored now. The toolbar and the media button come from the level that sets the content type Editor, or from a higher level.

  1. Find the tables where a column, row or cell has its own toolbar or media setting.
  2. Set the content type Editor on that same level.
  3. Check that the toolbar and the media button are what you expect.

Read the guide to set up editing options →

The REST API rejects invalid option values

Affects you if a REST client writes table options with values that are not allowed, for example a content type other than st, ed or none, or y and n options with another value. Before, the schema had no list of allowed values. Now such a request fails with the error rest_invalid_param (status 400).

  1. Look in the logs of your clients for 400 errors with rest_invalid_param on table fields.
  2. Compare the sent values with the allowed values in the schema and in the REST API documentation.
  3. Fix the values in the client.

Saving with the Table Manager and update_field() is checked

Affects you if your code saves tables with update_field(), update_sub_field() or the Table Manager. Values that are not table data no longer cause a PHP error and no longer overwrite the table: the stored table is kept. The Table Manager also rejects a save that moves the number of rows or columns away from the minimum or maximum of the field settings, and returns false.

  1. Check the return value of update_field() and update_sub_field() of the Table Manager. Do not assume that a save worked.
  2. Call get_last_error() after a rejected save. It returns the reason, for example rows_above_max.
  3. If your code must go beyond the limits, switch the check off with the filter acf_tablefield/table_manager/enforce_field_limits.

The field in the output filters can be null

Affects you if you use the filters of the table output (get_table/before_table, prepend_table, sections, append_table, after_table and the get_table/attr filters) and check the parameter field with false === $param['field']. If no field can be found, it is null now instead of false. If a field name is the selector, you get the ACF field array now.

  1. Search your code for checks of field in these filters.
  2. Replace them with empty( $param['field'] ).

Read about the filter get_table/before_table →

Table attributes are escaped

Affects you if a filter get_table/attr/… adds attributes with names that are not valid HTML attribute names, or values you rely on being output raw. Invalid names are skipped, values are escaped with esc_attr(), and colspan and rowspan are numbers of 2 or more.

  1. Open a table with your attribute filters on the website and look at the HTML of the table.
  2. Rename attributes that were skipped and remove markup from values.

Cell formatting

A new Formatting tab in the table options has nine options: horizontal and vertical alignment, font weight, italic, font size, transform (for example uppercase), decoration (for example underline), numbers and wrapping. You can set them for the whole table, for the header, body, footer and stub column, and for single columns, rows and cells. Each option is one button that shows the value that applies and where it comes from, for example Center inherited from Column 2. The table editor shows the formatting right away, so you see what you get while you edit.

Read the cell formatting guide →

How the levels work together

The more specific level wins, in this order: cell, row, column, stub column, header, body or footer, table. An option that is not set on a level inherits its value from the next one. Theme leaves the look to your theme: on the table it is the default, and on a lower level it brings a cell, row or column back to the theme, even when a higher level sets something else.

On your website

Formatted cells get the attribute data-acftf-format with tokens like ha-center or fw-700. A small stylesheet, formatting.css, turns these tokens into styles. It is only loaded on pages that have formatted cells. In feeds, the formatting is also added as inline styles, so it reaches feed readers and newsletters too.

If your theme styles the tokens itself, you can turn the stylesheet off with the filter acf_tablefield/formatting/enqueue_style. The tokens can be changed with the filters acf_tablefield/formatting/cell_tokens (PHP) and formatting/cell_tokens (JavaScript).

Developers can change the font sizes and the offered font weights, let no-wrap cells wrap on small screens, turn on inline styles for emails or PDFs, and add their own formatting areas with the new filters font_sizes, font_weights, nowrap_min_width, inline_styles and areas. For headless sites, the formatted value of a table has a format object on every cell with the formatting that applies to it, see the REST API.

Switch it on in the field settings

The formatting is off until you switch it on, for new fields and for existing fields after the update. In the field settings, check the Formatting tab and the options you want to give editors, per level and for the header, body, footer and stub column. Unchecking an option only hides it in the editor. Values that are already set, for example in the default table, still apply. This way you can predefine a formatting that editors can't change.

The Table Manager is officially released

The Table Manager is the PHP API to read and change table data in your own code. table_manager() loads a table field, and its methods add, remove and move rows and columns, change options and cell content, and save the result.

Every change is checked before it is applied: Is the option allowed in this place? Is the value valid? Would it create a conflict with spanned cells? A save also respects the minimum and maximum number of rows and columns from the field settings. A rejected call returns false and leaves the table unchanged, and get_last_error() tells you why.

Example

$table = table_manager();
$table->get_field( 'price_list', 42 );

// Adds a column at the end of the table
$table->add_column();

if ( ! $table->update_field() ) {

	$error = $table->get_last_error();
}

Read the Table Manager documentation →

Abilities API and MCP

The table functions of the plugin are now available as abilities of the WordPress Abilities API (WordPress 6.9 or later). This lets tools and AI agents read and change tables in a defined and permission-checked way.

  • In the new Features tab of the plugin settings, you can switch the abilities on for the Abilities REST API (/wp-json/wp-abilities/v1/).
  • A second switch makes them public for MCP clients through the MCP Adapter.
  • Both switches are off by default, and every call checks the capabilities of the user.
  • The Abilities REST API is separate from the REST API support of the table field. These switches don't change the REST API of the field.

Read the Abilities documentation →

A redesigned settings page

The plugin settings page has been redesigned to match the look of the ACF settings pages. It now has the tabs General, License, Updates and Features. The Updates tab shows the installed and the latest version, together with the latest changelog entries.

The shortcode can be switched on and off

The shortcode [tablefieldpro] can now be switched on or off in the Features tab. Like the ACF shortcode since ACF 6.3, it is off by default for new installs. Sites that used the plugin before keep it on, so nothing changes for existing content. While the shortcode is off, it outputs nothing. The filter acf_tablefield/shortcode/enabled overrides the setting.

If you set up a new site and want to use the shortcode, switch it on in the Features tab first. Read the shortcode documentation →

Editor toolbar and media button

In the field settings, Editor Toolbar and Enable Media Insertion can now be switched off as sub options of Editor, for the table, columns, rows and cells. Switching them off only hides the options in the content type tab. Values that are already set, for example in the default table, still apply, so you can predefine the toolbar and the media button there. Existing field groups keep both options enabled.

Enable Media Insertion is now a select with Inherit, On and Off instead of a checkbox. Inherit is the default for columns, rows and cells. The table itself has On or Off.

The toolbar and the media button now come from the level where the content type Editor is set, or from a higher level if that level is set to Inherit. Toolbar and media settings of columns, rows or cells that inherit their content type are ignored. Read the guide to set up editing options →

And more

The REST API schema now defines the allowed values of the table options, and requests with other values are rejected. When a row or column is removed that is covered by a spanned cell, the editor now shrinks the span. And this release fixes several bugs, for example JSON strings with quotation marks passed to update_field(), and Reset in the default table of the field settings. We recommend updating to get these improvements. All changes are listed below.

Changelog

  • New – The Table Manager is officially released.
  • New – Cell formatting: a new Formatting tab sets the horizontal and vertical alignment, font weight, italic, font size, transform, decoration, numbers and wrapping for the table, the header, body, footer and stub column, and for single columns, rows and cells. Each option shows the value that applies and where it comes from.
  • New – Formatted cells get the attribute data-acftf-format with tokens like ha-center or fw-700. The stylesheet formatting.css is only loaded on pages with formatted cells and can be turned off with the filter acf_tablefield/formatting/enqueue_style. The tokens can be changed with the filters acf_tablefield/formatting/cell_tokens (PHP) and formatting/cell_tokens (JavaScript). New filters: acf_tablefield/formatting/font_sizes, acf_tablefield/formatting/font_weights, acf_tablefield/formatting/nowrap_min_width, acf_tablefield/formatting/inline_styles, acf_tablefield/formatting/areas (PHP) and formatting/area_covers (JavaScript).
  • New – The formatting is switched on in the field settings: the Formatting tab and each of its options per level and for the header, body, footer and stub column. All of them are off by default, also for existing fields.
  • New – The Table Manager reads and changes the formatting with readable names and values, like font_weight and 700.
  • New – The formatted value of a table (get_field(), REST API with acf_format=standard) has a format object on every cell with the formatting that applies to it.
  • New – In feeds, formatted cells also get the formatting as inline styles.
  • New – Editor Toolbar and Enable Media Insertion can be switched off in the field settings as sub options of Editor, for the table, columns, rows and cells.
  • New – The table functions are available as abilities of the WordPress Abilities API (WordPress 6.9 or later), with switches for the Abilities REST API and MCP clients in the new Features tab. Both are off by default.
  • New – The shortcode [tablefieldpro] can be switched on or off in the Features tab. It is off by default for new installs. Existing sites keep it on. The filter acf_tablefield/shortcode/enabled overrides the setting.
  • Change – The plugin settings page has been redesigned to match the ACF settings pages, with the tabs General, License, Updates and Features.
  • Change – The REST API schema defines the allowed values of the table options content type (including None), editor toolbar, header, footer, stub column, preview caption and the output options. Requests with other values are rejected.
  • Change – The editor shrinks cell spans when a covered row or column is removed and shows all delete buttons.
  • Change – Enable Media Insertion is a select with Inherit, On and Off instead of a checkbox.
  • Change – The editor toolbar and the media button come from the level where the content type Editor is set, or from a higher level if that level is set to Inherit.
  • Change – The REST API accepts an empty value for the media insertion option am below the table level, which means inherit.
  • Change – The output filters of get_table() and the Table Manager (get_table/before_table, prepend_table, sections, append_table, after_table and the get_table/attr filters) get the ACF field array in field also when a field name is the selector, or null if no field can be resolved. Before, it was false.
  • Fix – JSON strings passed to update_field() or the GraphQL mutation are no longer rejected when the content contains quotation marks, and they keep plus and percent signs.
  • Fix – Invalid values passed to update_field(), update_sub_field() or the Table Manager no longer cause a PHP fatal error and no longer overwrite the stored table.
  • Fix – The content type select no longer shows None when Editor is the saved content type but has been disabled in the field settings.
  • Fix – Reset in the default table of the field settings resets the table to the plugin defaults. The same applies to an import with overwrite there.

Questions or problems after updating? Contact support.

Previous and Next Sources

Parent sources