ACF Table Field Pro Add-on Docs Last updated:

Filter acf_tablefield/get_table/attr/cell

This filter enables filtering table cells HTML element attributes using get_table() or other table HTML returning functions and methodes.

Parameters

add_filter( 'acf_tablefield/get_table/attr/cell', function( $attr, $data ) { 
 
	$attr['class'][] = 'highlighted'; 
 
	return $attr; 
}, 10, 2 );
    • $attr
    • (array)
    • A key value pair array of the html element attributes.

    • $data['field']
    • (array)
    • ACF field oject

    • $data['selector']
    • (string)
    • Field name or key

    • $data['post_id']
    • (integer)
    • The post ID

    • $data['section_key']
    • (string)
    • The table section like thead, tbody or tfoot

    • $data['col_index']
    • (integer)
    • The index of the cells column

    • $data['row_index']
    • (integer)
    • The index of the cells row

    • $data['item_data']
    • (array)
    • The data of the current table cell

    • $data['table_data']
    • (integer)
    • The data of the table

    • $data['manager_id']
    • (string)
    • The table manager id if set.

Result

<td class="highlighted"></td>

Previous and Next Sources

Parent sources

Parent sources

On this page