• Resolved Rogier van Roon

    (@bureauklik)


    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)
  • Plugin Author Stefan van den Dungen Gronovius

    (@dungengronovius)

    Please report any Admin Columns Pro issue on our forums on our website.

    Based on your snippet, you only want to hide the empty value in our filter dropdowns for all your custom field columns, correct? Your snippet is correct, and I can make it work on my own environment.

    Are you sure the filter is running?

Viewing 1 replies (of 1 total)
  • The topic ‘Hide empty option from filter menu’ is closed to new replies.