get_tags
Retrieves all post tags.
Description
(array) get_tags( (string) $args = '' );
Returns (array)
List of tags.
Parameters (1)
- 0. $args — Optional. (string) =>
''
- Tag arguments to use when retrieving tags.
Usage
if ( !function_exists( 'get_tags' ) ) { require_once ABSPATH . WPINC . '/category.php'; } // Tag arguments to use when retrieving tags. $args = ''; // NOTICE! Understand what this does before running. $result = get_tags($args);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/category.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;
- }