get_tags( string|array $args = '' )
Retrieves all post tags.
Contents
Description Description
See also See also
- get_terms(): For list of arguments to pass.
Parameters Parameters
- $args
-
(string|array) (Optional) Tag arguments to use when retrieving tags.
Default value: ''
Return Return
(WP_Term[]|int) $tags Array of 'post_tag' term objects, or a count thereof.
Source Source
File: wp-includes/category.php
function get_tags( $args = '' ) { $defaults = array( 'taxonomy' => 'post_tag' ); $args = wp_parse_args( $args, $defaults ); $tags = get_terms( $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 WP_Term[]|int $tags Array of 'post_tag' term objects, or a count thereof. * @param array $args An array of arguments. @see get_terms() */ $tags = apply_filters( 'get_tags', $tags, $args ); return $tags; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Displays a list of tags with links to each one and a specific class for each tag:
Display all tags in list format with links.