WordPress.org

Make WordPress Core

Changeset 41191


Ignore:
Timestamp:
07/30/17 15:09:31 (7 weeks ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r41037 r41191  
    39333933    $termlink = $wp_rewrite->get_extra_permastruct($taxonomy); 
    39343934 
     3935    /** 
     3936     * Filters the permalink structure for a terms before token replacement occurs. 
     3937     * 
     3938     * @since 4.9.0 
     3939     * 
     3940     * @param string  $termlink The permalink structure for the term's taxonomy. 
     3941     * @param WP_Term $term     The term object. 
     3942     */ 
     3943    $termlink = apply_filters( 'pre_term_link', $termlink, $term ); 
     3944 
    39353945    $slug = $term->slug; 
    39363946    $t = get_taxonomy($taxonomy); 
Note: See TracChangeset for help on using the changeset viewer.