Posts: Rename the $args parameter in get_post_types_by_support() to $feature for better self-documentation.

See #34010. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36704 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2016-02-25 04:55:01 +00:00
parent be75cdbe7c
commit 4acfd64d93

View File

@ -1639,23 +1639,23 @@ function post_type_supports( $post_type, $feature ) {
} }
/** /**
* Get a list of post type names that support a specific feature. * Retrieves a list of post type names that support a specific feature.
* *
* @since 4.5.0 * @since 4.5.0
* *
* @global array $_wp_post_type_features * @global array $_wp_post_type_features Post type features
* *
* @param array|string $args Single feature or an array of features the post types should support. * @param array|string $feature Single feature or an array of features the post types should support.
* @param string $operator Optional. The logical operation to perform. 'or' means * @param string $operator Optional. The logical operation to perform. 'or' means
* only one element from the array needs to match; 'and' * only one element from the array needs to match; 'and'
* means all elements must match; 'not' means no elements may * means all elements must match; 'not' means no elements may
* match. Default 'and'. * match. Default 'and'.
* @return array A list of post type names. * @return array A list of post type names.
*/ */
function get_post_types_by_support( $args, $operator = 'and' ) { function get_post_types_by_support( $feature, $operator = 'and' ) {
global $_wp_post_type_features; global $_wp_post_type_features;
$features = array_fill_keys( (array) $args, true ); $features = array_fill_keys( (array) $feature, true );
return array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) ); return array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) );
} }