WordPress at a glance

get_tags() WP 1.0

Retrieves all post tags.

  • See: get_terms() For list of arguments to pass.
Works based on: get_terms()
Hooks from function:
Return

Array. List of tags.

Usage

get_tags( $args );
$args(string/array)
Tag arguments to use when retrieving tags.
Default: ''

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

<?php
function get_tags( $args = '' ) {
	$tags = get_terms( 'post_tag', $args );

	if ( empty( $tags ) ) {
		$return = array();
		return $return;
	}

	/**
	 * Filters the array of term objects returned for the 'post_tag' taxonomy.
	 *
	 * @since 2.3.0
	 *
	 * @param array $tags Array of 'post_tag' term objects.
	 * @param array $args An array of arguments. @see get_terms()
	 */
	$tags = apply_filters( 'get_tags', $tags, $args );
	return $tags;
}

Related Functions

From category: Tags

No comments
    Hello, !     Log In . Register