WordPress at a glance

the_tags() WP 1.0

Retrieve the tags for a post.

Works based on: get_the_tag_list()
1 time = 0.005842s = very slow | 50000 times = 5.53s = fast | PHP 7.1.2, WP 4.7.3

No Hooks.

Return

Null. Nothing.

Usage

the_tags( $before, $sep, $after );
$before(string)
String to use before the tags.
Default: 'Tags:'
$sep(string)
String to use between the tags.
Default: ', '
$after(string)
String to use after the tags.
Default: ''

Changelog

Since 2.3.0 Introduced.

Code of the_tags() WP 5.5.1

<?php
function the_tags( $before = null, $sep = ', ', $after = '' ) {
	if ( null === $before ) {
		$before = __( 'Tags: ' );
	}

	$the_tags = get_the_tag_list( $before, $sep, $after );

	if ( ! is_wp_error( $the_tags ) ) {
		echo $the_tags;
	}
}

From tag: WP Loop

More from category: For posts

More from Template Tags: Posts, Pages, ...

No comments
    Log In . Register