I'm using a filter to remove the "first" and "last" classes from the product-grid.
When I set $classes to NULL it removes all of them, but my code should remove just the two. But that doesn't work.
add_filter( 'post_class', 'prefix_post_class', 21 );
function prefix_post_class( $classes ) {
if ( 'product' == get_post_type() ) {
$classes = array_diff( $classes, array( 'first', 'last' ) );
// $classes = NULL; <-- This works strangely enough
}
return $classes;
}