Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_terms_defaults

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
235            * Filters the terms query default arguments.
236            *
237            * Use {@see 'get_terms_args'} to filter the passed arguments.
238            *
239            * @since 4.4.0
240            *
241            * @param array    $defaults   An array of default get_terms() arguments.
242            * @param string[] $taxonomies An array of taxonomy names.
243            */
244           $this->query_var_defaults = apply_filters( 'get_terms_defaults', $this->query_var_defaults, $taxonomies );
245
246           $query = wp_parse_args( $query, $this->query_var_defaults );
247
248           $query['number'] = absint( $query['number'] );
249           $query['offset'] = absint( $query['offset'] );
250
251           // 'parent' overrides 'child_of'.
252           if ( 0 < intval( $query['parent'] ) ) {
253                $query['child_of'] = false;