Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rest_{$this->taxonomy}_collection_params

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1118            * This filter registers the collection parameter, but does not map the
1119            * collection parameter to an internal WP_Term_Query parameter.  Use the
1120            * `rest_{$this->taxonomy}_query` filter to set WP_Term_Query parameters.
1121            *
1122            * @since 4.7.0
1123            *
1124            * @param array       $query_params JSON Schema-formatted collection parameters.
1125            * @param WP_Taxonomy $taxonomy     Taxonomy object.
1126            */
1127           return apply_filters( "rest_{$this->taxonomy}_collection_params", $query_params, $taxonomy );
1128      }
1129
1130      /**
1131       * Checks that the taxonomy is valid.
1132       *
1133       * @since 4.7.0
1134       *
1135       * @param string $taxonomy Taxonomy to check.
1136       * @return bool Whether the taxonomy is allowed for REST management.