term_link
The WordPress Core term link hook.
Description
Parameters (3)
- 0. $post_format_link (string) =>
'_post_format_link'
- The post format link.
- 1. $int (int) =>
10
- The int.
- 2. $int (int) =>
3
- The int.
Usage
- To run the hook, copy the example below.
- $post_format_link = apply_filters( 'term_link', $post_format_link, $int, $int );
- if ( !empty( $post_format_link ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the term_link callback
- function filter_term_link( $post_format_link, $int, $int ) {
- // make filter magic happen here...
- return $post_format_link;
- };
- // add the filter
- add_filter( 'term_link', 'filter_term_link', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'term_link', 'filter_term_link', 10, 3 );
Defined (2)
The filter is defined in the following location(s).
- /wp-includes/default-filters.php
- add_filter( 'term_link', '_post_format_link', 10, 3 );
- /wp-includes/taxonomy.php
- return apply_filters( 'term_link', $termlink, $term, $taxonomy );