Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_wp_filter_taxonomy_base() WordPress Function

The wp_filter_taxonomy_base function allows you to filter the taxonomy base before it is used by WordPress. This can be useful if you want to change the way WordPress handles taxonomies.

_wp_filter_taxonomy_base( string $base ) #

Filters the URL base for taxonomies.


Description

To remove any manually prepended /index.php/.


Top ↑

Parameters

$base

(string)(Required)The taxonomy base that we're going to filter


Top ↑

Return

(string)


Top ↑

Source

File: wp-includes/rewrite.php

function _wp_filter_taxonomy_base( $base ) {
	if ( ! empty( $base ) ) {
		$base = preg_replace( '|^/index\.php/|', '', $base );
		$base = trim( $base, '/' );
	}
	return $base;
}

Top ↑

Changelog

Changelog
VersionDescription
2.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.