get_the_tags
Filters the array of tags for the given post.
Description
Parameters (1)
- 0. $get_the_terms (array) =>
get_the_terms( $id, 'post_tag' )
- An array of tags for the given post.
Usage
- To run the hook, copy the example below.
- $get_the_terms = apply_filters( 'get_the_tags', $get_the_terms );
- if ( !empty( $get_the_terms ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the get_the_tags callback
- function filter_get_the_tags( $get_the_terms ) {
- // make filter magic happen here...
- return $get_the_terms;
- };
- // add the filter
- add_filter( 'get_the_tags', 'filter_get_the_tags', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'get_the_tags', 'filter_get_the_tags', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/category-template.php
- return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) );