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
1109       * Filter the terms query default arguments.
1110       *
1111       * Use 'get_terms_args' to filter the passed arguments.
1112       *
1113       * @since 4.4.0
1114       *
1115       * @param array $defaults   An array of default get_terms() arguments.
1116       * @param array $taxonomies An array of taxonomies.
1117       */
1118      $args = wp_parse_args( $args, apply_filters( 'get_terms_defaults', $defaults, $taxonomies ) );
1119
1120      $args['number'] = absint( $args['number'] );
1121      $args['offset'] = absint( $args['offset'] );
1122
1123      // Save queries by not crawling the tree in the case of multiple taxes or a flat tax.
1124      $has_hierarchical_tax = false;
1125      foreach ( $taxonomies as $_tax ) {
1126           if ( is_taxonomy_hierarchical( $_tax ) ) {
1127                $has_hierarchical_tax = true;