| 1201 | * Get a list of post type names that support a specific feature. |
| 1202 | * |
| 1203 | * @since 4.4.0 |
| 1204 | * |
| 1205 | * @global array $_wp_post_type_features Associative array of post types with accepted features. |
| 1206 | * |
| 1207 | * @param string|array $feature String of a single post type support feature or array |
| 1208 | * (e.g., `'title'` or `array( 'title' => true )`). |
| 1209 | * |
| 1210 | * @return array $post_types Array of post type names that support a feature. |
| 1211 | */ |
| 1212 | function get_post_types_by_support( $feature ) { |
| 1213 | global $_wp_post_type_features; |
| 1214 | $features = ! is_array( $feature ) ? array( $feature => true ) : $feature; |
| 1215 | $post_types = array_keys( |
| 1216 | wp_filter_object_list( $_wp_post_type_features, $features ) |
| 1217 | ); |
| 1218 | return $post_types; |
| 1219 | } |
| 1220 | |
| 1221 | /** |