Switch language

wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren




wp_get_post_terms [ WordPress Function ]

wp_get_post_terms ( $post_id = 0, $taxonomy = 'post_tag', $args = array() )
Parameter:
  • (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
Nutzt:
Gibt zurück:
  • (array) List of post tags.
Definiert in:



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;
}
?>

Beispiele [ wp-snippets.com ]

Top Google Suchergebnisse

Mehr ...

0 Nutzerkommentare

Noch keine. Sei der Erste!

Neu hinzufügen ...



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