Filter acf_tablefield/get_table/attr/caption
This filter enables filtering the caption HTML element attributes using get_table() or other table HTML returning functions and methodes.
Parameters
add_filter( 'acf_tablefield/get_table/attr/caption', function( $attr, $data ) {
$attr['class'][] = 'highlighted';
return $attr;
}, 10, 2 );
-
$attrA key value pair array of the html element attributes.
-
$data['field']ACF field oject
-
$data['selector']Field name or key
-
$data['post_id']The post ID
-
$data['item_data']The data of the current table cell
-
$data['table_data']The data of the table
Result
<caption class="highlighted"></caption>