Problems with acp/filtering/dropdown_args
First… how do I change my name from ‘Amy’ to ‘Keith’ here in support? :) My account has no indication of ‘Amy’ anymore.
Alright, here is the real issue. I have an ACF True/False field that determines the ‘Status’ of a Project. I turned on Filtering for this field.
By default… Admin Columns shows: All Status and false as options.
Choosing ‘false’ does nothing. I would assume it would show all records that have ‘Status’ set to False, but it doesn’t.
Either way… I decided to remove ‘false’ from the dropdown and use “Incomplete” and “Complete” instead. They show up as expected, but neither produce an results.
Here’s my code:
<?php
/* START: Changes 'Project Status' filtering choices */
function cc_change_project_status_filtering( $args, $column ) {
$column_type = 'column-acf_field';
$acf_key = 'field_59b3ee7a68104'; // Project Status field
if ( $column_type === $column->get_type() && $acf_key === $column->get_setting( 'field' )->get_value() ) {
unset( $args['options'] );
$args['options'][0] = 'Incomplete';
$args['options'][1] = 'Complete';
}
return $args;
}
add_filter( 'acp/filtering/dropdown_args', 'cc_change_project_status_filtering', 10, 2 );
/* END: Changes 'Project Status' filtering choices */
?>
For the [value] I have tried: 0, ‘0’, FALSE etc. but none worked.
Thanks for your help on this!
Keith (not Amy) :)
You must be logged in to reply to this topic.