Problems with ac/headings/label
Hello…
Great plugin! I am starting to give deeper into the actions/filters and am having an issue.
I want to alter the label with code. I assume this is the filter to use: ac/headings/label
When I use it, I am able to edit $label directly… but I want it to be conditional based on the $column.
First… is this an ‘action’ or a ‘filter’? I see here in the docs to use: add_action but when I look in the code I see: apply_filters
At any rate, I tried both, and when I reference $column I get a blank screen on the Posts Listing page.
Here’s my test code that I placed in a custom function:
function cc_ac_column_heading_label( $label, $column ) {
if ( 'column-acf_field' == $column->get_type() ) {
$acf_key = $column->get_setting( 'field' )->get_value(); // Gets the stored ACF key for the stored column
if ( 'field_59b3fa2f8934b' == $acf_key ) {
$label = "V";
}
}
return $label;
}
add_filter( 'ac/headings/label', 'cc_ac_column_heading_label' );
Any suggestions? Thanks!
You must be logged in to reply to this topic.