Filtersacf_tablefield/shortcode/escape_htmlPHPRelease Candidate1.8.0
shortcode escape html esc kses security
Since version: v1.8.0
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_htmltrueescapes the table HTML of the shortcode,falseoutputs it unchanged.-
Defaults:
true
-
$attsThe attributes of the shortcode:
field,subfield,post_idandtable_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 );