ACF Table Field Pro Add-on Docs Last updated:

Parent sources

On this page

Since version: v1.8.0

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.

Filter acf_tablefield/shortcode/escape_html

The shortcode [tablefieldpro] escapes the table HTML with acf_esc_html() (like wp_kses_post()), so unsafe HTML such as <script> or event attributes like onerror is removed. This filter turns the escaping off. There is no shortcode attribute for it, because users who only have the capability to write shortcodes, for example contributors, could use it to output unsafe HTML. To switch the shortcode off or on, use the filter acf_tablefield/shortcode/enabled.

Parameters

add_filter( 'acf_tablefield/shortcode/escape_html', '__return_false' );
    • $escape_html
    • (bool)
    • true escapes the table HTML of the shortcode, false outputs it unchanged.

    • Defaults: true
    • $atts
    • (array)
    • The attributes of the shortcode: field, subfield, post_id and table_class.

Example: no escaping for one field

add_filter( 'acf_tablefield/shortcode/escape_html', function( $escape_html, $atts ) { 
 
	if ( 'my_trusted_table' === $atts['field'] ) { 
 
		return false; 
	} 
 
	return $escape_html; 
}, 10, 2 );

Security

Only turn the escaping off if all users who can edit the table data or write shortcodes are trusted.

Previous and Next Sources

Parent sources