Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_{$taxonomy}

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

This hook occurs 2 times in this file.

Line Code
993       *
994       * The dynamic portion of the filter name, $taxonomy, refers
995       * to the taxonomy slug.
996       *
997       * @since 2.3.0
998       *
999       * @param int|object $_term    Term object or ID.
1000       * @param string     $taxonomy The taxonomy slug.
1001       */
1002      $_term = apply_filters( "get_$taxonomy", $_term, $taxonomy );
1003      $_term = sanitize_term($_term, $taxonomy, $filter);
1004
1005      if ( $output == OBJECT ) {
1006           return $_term;
1007      } elseif ( $output == ARRAY_A ) {
1008           $__term = get_object_vars($_term);
1009           return $__term;
1010      } elseif ( $output == ARRAY_N ) {
1011           $__term = array_values(get_object_vars($_term));
 
Line Code
1069      if ( !$term )
1070           return false;
1071
1072      wp_cache_add($term->term_id, $term, $taxonomy);
1073
1074      /** This filter is documented in wp-includes/taxonomy.php */
1075      $term = apply_filters( 'get_term', $term, $taxonomy );
1076
1077      /** This filter is documented in wp-includes/taxonomy.php */
1078      $term = apply_filters( "get_$taxonomy", $term, $taxonomy );
1079
1080      $term = sanitize_term($term, $taxonomy, $filter);
1081
1082      if ( $output == OBJECT ) {
1083           return $term;
1084      } elseif ( $output == ARRAY_A ) {
1085           return get_object_vars($term);
1086      } elseif ( $output == ARRAY_N ) {
1087           return array_values(get_object_vars($term));