wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_the_tag_list › WordPress Function

Depuis2.3.0
Dépréciéen/a
get_the_tag_list ( $before = '', $sep = '', $after = '', $post_id = 0 )
Paramètres: (4)
  • (string) $before Optional. String to use before the tags. Default empty.
    Requis: Non
    Défaut: (vide)
  • (string) $sep Optional. String to use between the tags. Default empty.
    Requis: Non
    Défaut: (vide)
  • (string) $after Optional. String to use after the tags. Default empty.
    Requis: Non
    Défaut: (vide)
  • (int) $post_id Optional. Post ID. Defaults to the current post ID.
    Requis: Non
    Défaut:
Retourne:
  • (string|false|WP_Error) A list of tags on success, false if there are no terms, WP_Error on failure.
Défini(e) dans:
Codex:

Retrieves the tags for a post formatted as a string.



Source

function get_the_tag_list( $before = '', $sep = '', $after = '', $post_id = 0 ) {
	$tag_list = get_the_term_list( $post_id, 'post_tag', $before, $sep, $after );

	/**
	 * Filters the tags list for a given post.
	 *
	 * @since 2.3.0
	 *
	 * @param string $tag_list List of tags.
	 * @param string $before   String to use before the tags.
	 * @param string $sep      String to use between the tags.
	 * @param string $after    String to use after the tags.
	 * @param int    $post_id  Post ID.
	 */
	return apply_filters( 'the_tags', $tag_list, $before, $sep, $after, $post_id );
}