Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: term_exists_default_query_args

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
1540       * @since 6.0.0
1541       *
1542       * @param array      $defaults An array of arguments passed to get_terms().
1543       * @param int|string $term     The term to check. Accepts term ID, slug, or name.
1544       * @param string     $taxonomy The taxonomy name to use. An empty string indicates
1545       *                             the search is against all taxonomies.
1546       * @param int|null   $parent   ID of parent term under which to confine the exists search.
1547       *                             Null indicates the search is unconfined.
1548       */
1549      $defaults = apply_filters( 'term_exists_default_query_args', $defaults, $term, $taxonomy, $parent );
1550
1551      if ( is_int( $term ) ) {
1552           if ( 0 === $term ) {
1553                return 0;
1554           }
1555           $args  = wp_parse_args( array( 'include' => array( $term ) ), $defaults );
1556           $terms = get_terms( $args );
1557      } else {
1558           $term = trim( wp_unslash( $term ) );