Snippets repository for WordPress developpers

Browse
// functions.php
function clean_post_classes( $classes ) {
  if( ! is_array( $classes ) )
    return $classes;
    $allowed_classes = array(
      'hentry',
      'type-' . get_post_type(),
    );
    return array_intersect( $classes, $allowed_classes );
}
add_filter( 'post_class', 'clean_post_classes', 5 );

Warning: Trying to access array offset on null in /home/clients/7f7a8d8eb6e40c50d3548b06c548734d/web/wp-includes/class-wp-query.php on line 3766

Categories

Tags