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
1234       * Filter the terms query default arguments.
1235       *
1236       * Use 'get_terms_args' to filter the passed arguments.
1237       *
1238       * @since 4.4.0
1239       *
1240       * @param array $defaults   An array of default get_terms() arguments.
1241       * @param array $taxonomies An array of taxonomies.
1242       */
1243      $args = wp_parse_args( $args, apply_filters( 'get_terms_defaults', $defaults, $taxonomies ) );
1244
1245      $args['number'] = absint( $args['number'] );
1246      $args['offset'] = absint( $args['offset'] );
1247
1248      // Save queries by not crawling the tree in the case of multiple taxes or a flat tax.
1249      $has_hierarchical_tax = false;
1250      if ( $taxonomies ) {
1251           foreach ( $taxonomies as $_tax ) {
1252                if ( is_taxonomy_hierarchical( $_tax ) ) {