Support for filterable custom columns
Hi there, I implemented filterable custom columns today with admin columns. I thought it would be supported by default, but I can see after looking at the code why it’s not. That said, I believe the way I supported it is extensible and generally in line with the style I saw in your plugin.
Could support for this feature be added?
I updated CAC_Filtering_Model_Post this way:
// in enable_filtering, added include type filter
$include_types = apply_filters( 'cac/addon/filtering/include_types', $include_types );
// in handle_filter_requests added default case to switch
default:
if(method_exists($column, ‘posts_where_for_custom_column’)){
add_filter(‘posts_where’, array($column, ‘posts_where_for_custom_column’));
}
break;
// in add_filtering_dropdown added default case to switch
default:
if(method_exists($column, ‘distinct_column_values’)){
$distinctVals = $column->distinct_column_values();
$options = array_combine($distinctVals,$distinctVals);
}
break;
`
You must be logged in to reply to this topic.