_wp_filter_taxonomy_base

Filters the URL base for taxonomies.

Description

(string) _wp_filter_taxonomy_base( (string) $base ); 

To remove any manually prepended /index.php/.

Returns (string)

Parameters (1)

0. $base (string)
The taxonomy base that we're going to filter

Usage

  1. if ( !function_exists( '_wp_filter_taxonomy_base' ) ) { 
  2. require_once ABSPATH . WPINC . '/rewrite.php'; 
  3.  
  4. // The taxonomy base that we're going to filter 
  5. $base = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _wp_filter_taxonomy_base($base); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/rewrite.php  
  1. function _wp_filter_taxonomy_base( $base ) { 
  2. if ( !empty( $base ) ) { 
  3. $base = preg_replace( '|^/index\.php/|', '', $base ); 
  4. $base = trim( $base, '/' ); 
  5. return $base;