WordPress.org

Make WordPress Core

Changeset 36704


Ignore:
Timestamp:
02/25/2016 04:55:01 AM (4 years ago)
Author:
DrewAPicture
Message:

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

See #34010. See #32246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r36652 r36704  
    16401640
    16411641/**
    1642  * Get a list of post type names that support a specific feature.
     1642 * Retrieves a list of post type names that support a specific feature.
    16431643 *
    16441644 * @since 4.5.0
    16451645 *
    1646  * @global array $_wp_post_type_features
    1647  *
    1648  * @param array|string $args     Single feature or an array of features the post types should support.
     1646 * @global array $_wp_post_type_features Post type features
     1647 *
     1648 * @param array|string $feature  Single feature or an array of features the post types should support.
    16491649 * @param string       $operator Optional. The logical operation to perform. 'or' means
    16501650 *                               only one element from the array needs to match; 'and'
     
    16531653 * @return array A list of post type names.
    16541654 */
    1655 function get_post_types_by_support( $args, $operator = 'and' ) {
     1655function get_post_types_by_support( $feature, $operator = 'and' ) {
    16561656    global $_wp_post_type_features;
    16571657
    1658     $features = array_fill_keys( (array) $args, true );
     1658    $features = array_fill_keys( (array) $feature, true );
    16591659
    16601660    return array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) );
Note: See TracChangeset for help on using the changeset viewer.