Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_get_post_terms [ WordPress Function ]

wp_get_post_terms ( $post_id = 0, $taxonomy = 'post_tag', $args = array() )
Parameters:
  • (int) $post_id Optional. The Post ID
  • (string) $taxonomy The taxonomy for which to retrieve terms. Defaults to post_tag.
  • (array) $args Optional. Overwrite the defaults
Uses:
Returns:
  • (array) List of post tags.
Defined at:



Retrieve the terms for a post.

There is only one default for this function, called 'fields' and by default is set to 'all'. There are other defaults that can be overridden in {@link wp_get_object_terms()}.

Source


<?php
function wp_get_post_terms$post_id 0$taxonomy 'post_tag'$args = array() ) {
    
$post_id = (int) $post_id;

    
$defaults = array('fields' => 'all');
    
$args wp_parse_args$args$defaults );

    
$tags wp_get_object_terms($post_id$taxonomy$args);

    return 
$tags;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics