Taxonomy: Introduce `pre_term_link` filter.

This filter allows developers to filter the taxonomy permalink
structure before a term's permalink is generated. It parallels
the 'pre_post_link' filter for the 'post' post type.

Props nikeo.
Fixes #39601.
Built from https://develop.svn.wordpress.org/trunk@41191


git-svn-id: http://core.svn.wordpress.org/trunk@41031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2017-07-30 15:10:44 +00:00
parent c657a2c060
commit 42ac7e7e13
2 changed files with 11 additions and 1 deletions

View File

@ -3932,6 +3932,16 @@ function get_term_link( $term, $taxonomy = '' ) {
$termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
/**
* Filters the permalink structure for a terms before token replacement occurs.
*
* @since 4.9.0
*
* @param string $termlink The permalink structure for the term's taxonomy.
* @param WP_Term $term The term object.
*/
$termlink = apply_filters( 'pre_term_link', $termlink, $term );
$slug = $term->slug;
$t = get_taxonomy($taxonomy);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41190';
$wp_version = '4.9-alpha-41191';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.