get_the_terms [ WordPress Function ]
get_the_terms ( $id, $taxonomy )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Retrieve the terms of the taxonomy that are attached to the post.
Source
<?php
function get_the_terms( $id, $taxonomy ) {
global $post;
$id = (int) $id;
if ( !$id ) {
if ( empty( $post->ID ) )
return false;
else
$id = (int) $post->ID;
}
$terms = get_object_term_cache( $id, $taxonomy );
if ( false === $terms ) {
$terms = wp_get_object_terms( $id, $taxonomy );
wp_cache_add($id, $terms, $taxonomy . '_relationships');
}
$terms = apply_filters( 'get_the_terms', $terms, $id, $taxonomy );
if ( empty( $terms ) )
return false;
return $terms;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get the terms « WordPress Codex
Description. Retrieve the terms of the taxonomy that are attached to the post. Usage. <?php get_the_terms( $id, $taxonomy ); ?> Parameters. $id: (int) ( required) ...
codex.wordpress.org - WordPress › Support » Tags — get_the_terms
(forgot?) Register · WordPress › Support » get_the_terms ...
wordpress.org - loops - Wordpress Development - get the terms - returns 'array ...
I am trying to get the terms of a specific taxonomy to display on a page. ... It's corrent. As reported in the codex page for get_the_terms() return an ...
stackoverflow.com - custom post types - Get_the_terms restrict output - WordPress
Mar 14, 2011 ... Creating a problem for my title display as I use get_the_terms. Somebody has better solution for me. My code is as follow $taxonomy = 'country' ...
wordpress.stackexchange.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- KGarrett on "Help calling filterable custom taxonomy"
- kcomphlint on "List Taxonomy Terms In Hierarchy"
- KGarrett on "Displaying & filtering custom taxonomies"
- thecorkboard on "PHP: Need help with if terms are empty"
- p0mP on "Exclude Term from get the term list not working when excluding all post terms"
- debsch on "`wp_get_post_categories` equivalent for custom taxonomies?"
- debsch on "`wp_get_post_categories` equivalent for custom taxonomies?"
- debsch on "`wp_get_post_categories` equivalent for custom taxonomies?"
- bazel on "Exclude Term from get the term list not working when excluding all post terms"
- keesiemeijer on "get_the_terms problem"