Hide empty option from filter menu
-
I’d tried to put the following filter (from your documention) to functions.php of my child theme, but the Empty / Not Empty in the pull downs filters are still showing.
/** * Hide empty option from filter menu * * @param array $args * @param AC_Column $column * * @return array */ function my_ac_filter_menu_remove_empty_options( $args, $column ) { $column_type = 'column-meta'; if ( $column_type === $column->get_type() ) { if ( isset( $args['empty_option'] ) ) { unset( $args['empty_option'] ); } } return $args; } add_filter( 'acp/filtering/dropdown_args', 'my_ac_filter_menu_remove_empty_options', 10, 2 );
Any suggestions what I fail to see I’m missing here?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Hide empty option from filter menu’ is closed to new replies.