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

Nothing (null).

Usage

the_tags( $before, $sep, $after );
$before(string)
Before list.
Default: null
$sep(string)
Separate items using this.
Default: ', '
$after(string)
After list.
Default: ''

Code of the_tags: wp-includes/category-template.php VER 4.9.8

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

Related Functions

From tag: WP Loop

More from category: For posts

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

No comments
    Hello, !     Log In . Register