WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 891 | return $null; |
| 892 | if ( ! $_term = wp_cache_get($term, $taxonomy) ) { |
| 893 | $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %d LIMIT 1", $taxonomy, $term) ); |
| 894 | if ( ! $_term ) |
| 895 | return $null; |
| 896 | wp_cache_add($term, $_term, $taxonomy); |
| 897 | } |
| 898 | } |
| 899 | |
| 900 | $_term = apply_filters('get_term', $_term, $taxonomy); |
| 901 | $_term = apply_filters("get_$taxonomy", $_term, $taxonomy); |
| 902 | $_term = sanitize_term($_term, $taxonomy, $filter); |
| 903 | |
| 904 | if ( $output == OBJECT ) { |
| 905 | return $_term; |
| 906 | } elseif ( $output == ARRAY_A ) { |
| 907 | $__term = get_object_vars($_term); |
| 908 | return $__term; |
| 909 | } elseif ( $output == ARRAY_N ) { |
| Line | Code |
| 963 | return $term; |
| 964 | } |
| 965 | |
| 966 | $term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND $field = %s LIMIT 1", $taxonomy, $value) ); |
| 967 | if ( !$term ) |
| 968 | return false; |
| 969 | |
| 970 | wp_cache_add($term->term_id, $term, $taxonomy); |
| 971 | |
| 972 | $term = apply_filters('get_term', $term, $taxonomy); |
| 973 | $term = apply_filters("get_$taxonomy", $term, $taxonomy); |
| 974 | $term = sanitize_term($term, $taxonomy, $filter); |
| 975 | |
| 976 | if ( $output == OBJECT ) { |
| 977 | return $term; |
| 978 | } elseif ( $output == ARRAY_A ) { |
| 979 | return get_object_vars($term); |
| 980 | } elseif ( $output == ARRAY_N ) { |
| 981 | return array_values(get_object_vars($term)); |