_wp_filter_taxonomy_base( string $base ): string

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.

Filters the URL base for taxonomies.

Description

To remove any manually prepended /index.php/.

Parameters

$basestringrequired
The taxonomy base that we’re going to filter

Return

string

Source

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

Changelog

VersionDescription
2.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.