diff --git wp-includes/post.php wp-includes/post.php
index 59506f8..2b814b8 100644
|
|
function post_type_supports( $post_type, $feature ) { |
1552 | 1552 | } |
1553 | 1553 | |
1554 | 1554 | /** |
| 1555 | * Get a list of post type names that support a specific feature. |
| 1556 | * |
| 1557 | * @since 4.5.0 |
| 1558 | * |
| 1559 | * @global array $_wp_post_type_features |
| 1560 | * |
| 1561 | * @param array|string $args Single feature or an array of features the post types should support. |
| 1562 | * @param string $operator Optional. The logical operation to perform. 'or' means only one |
| 1563 | * element from the array needs to match; 'and' means all elements |
| 1564 | * must match. Accepts 'or' or 'and'. Default 'and'. |
| 1565 | * @return array A list of post type names. |
| 1566 | */ |
| 1567 | function get_post_types_by_support( $args, $operator = 'and' ) { |
| 1568 | global $_wp_post_type_features; |
| 1569 | |
| 1570 | $features = array_fill_keys( (array) $args, true ); |
| 1571 | |
| 1572 | return array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) ); |
| 1573 | } |
| 1574 | |
| 1575 | /** |
1555 | 1576 | * Update the post type for the post ID. |
1556 | 1577 | * |
1557 | 1578 | * The page or post cache will be cleaned for the post ID. |