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



get_the_tags ›

Seit2.3.0
Veraltetn/v
get_the_tags ( $post_id = 0 )
Parameter:
  • (int|WP_Post) $post_id Post ID or object.
    Erforderlich: Nein
    Standard:
Gibt zurück:
  • (WP_Term[]|bool|WP_Error) Array of WP_Term objects on success, false if there are no terms or the post does not exist, WP_Error on failure.
Definiert in:
Codex:

Retrieves the tags for a post.



Quellcode

function get_the_tags( $post_id = 0 ) {
	$terms = get_the_terms( $post_id, 'post_tag' );

	/**
	 * Filters the array of tags for the given post.
	 *
	 * @since 2.3.0
	 *
	 * @see get_the_terms()
	 *
	 * @param WP_Term[]|false|WP_Error $terms Array of WP_Term objects on success, false if there are no terms
	 *                                        or the post does not exist, WP_Error on failure.
	 */
	return apply_filters( 'get_the_tags', $terms );
}