/** * Filters the post_class. * * @param array $classes * * @return array */ public function filter_post_class(array $classes) { /** @var \WP_Post $post */ global $post; if ($this->post_type !== $post->post_type) { return $classes; } // Add default classes $classes[] = 'talent'; if ($post !== get_queried_object() || wptalents_is_oembed()) { $classes[] = 'talent--small'; } return $classes; }
/** * Filters the post_class. * * @param array $classes * * @return array */ public function filter_post_class(array $classes) { /** @var WP_Post $post */ global $post; if ($this->post_type !== $post->post_type) { return $classes; } // Add default classes $classes[] = 'talent'; if ($post !== get_queried_object() || wptalents_is_oembed()) { $classes[] = 'talent--small'; } if (has_post_thumbnail($post->ID)) { $thumbnail = get_attached_file(get_post_thumbnail_id($post->ID)); // Add map thumbnail class if ($thumbnail && 0 === strpos(basename($thumbnail), $post->post_name . '-map')) { $classes[] = 'has-post-thumbnail-map'; } } return $classes; }