_wp_filter_taxonomy_base()
Filters the URL base for taxonomies.
To remove any manually prepended /index.php/.
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Returns
String.
Usage
_wp_filter_taxonomy_base( $base );
- $base(string) (required)
- The taxonomy base that we're going to filter.
Changelog
| Since 2.6.0 | Introduced. |
_wp_filter_taxonomy_base() wp filter taxonomy base code WP 6.8.3
function _wp_filter_taxonomy_base( $base ) {
if ( ! empty( $base ) ) {
$base = preg_replace( '|^/index\.php/|', '', $base );
$base = trim( $base, '/' );
}
return $base;
}