Make WordPress Core


Ignore:
Timestamp:
12/21/2016 05:33:15 AM (7 years ago)
Author:
pento
Message:

REST API: Improve the rest_*_collection_params filter docs and fix the terms filter.

The rest_{$taxonomy}_collection_params filter in 4.7 is incorrectly using single quotes instead of double quotes, which means it is not working correctly as a dynamic filter. This fixes the quotes around the filter name, and also updates the docblocks for the other 3 similar filters for better conformance to the documentation standards.

Merge of [39621] to the 4.7 branch.

Props shazahm1hotmailcom, JPry, jnylen0.
Fixes #39300.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

    r39465 r39631  
    972972         * @since 4.7.0
    973973         *
    974          * @param $params JSON Schema-formatted collection parameters.
    975          * @param WP_Taxonomy $taxonomy_obj Taxonomy object.
     974         * @param array       $query_params JSON Schema-formatted collection parameters.
     975         * @param WP_Taxonomy $taxonomy    Taxonomy object.
    976976         */
    977         return apply_filters( 'rest_{$this->taxonomy}_collection_params', $query_params, $taxonomy );
     977        return apply_filters( "rest_{$this->taxonomy}_collection_params", $query_params, $taxonomy );
    978978    }
    979979
Note: See TracChangeset for help on using the changeset viewer.