post_type => label */ public static function eligible(): array { $post_types = get_post_types( array( 'public' => true ), 'objects' ); $eligible = array(); foreach ( $post_types as $post_type ) { if ( post_type_supports( $post_type->name, 'thumbnail' ) ) { $eligible[ $post_type->name ] = $post_type->labels->singular_name; } } /** * Filters which post types are eligible for the default featured image. * * @since 2.0.0 * * @param array $eligible post_type => label. */ return apply_filters( 'aiou_featured_image_eligible_post_types', $eligible ); } }