_wp_filter_taxonomy_base

函数
_wp_filter_taxonomy_base ( $base )
Access
Private
参数
  • (string) $base The taxonomy base that we're going to filter
    Required:
返回值
  • (string)
定义位置
相关方法
wp_filter_nohtml_kseswp_get_term_taxonomy_parent_idwp_filter_post_ksesclean_taxonomy_cachewp_filter_kses
引入
2.6.0
弃用
-

_wp_filter_taxonomy_base: 这是一个WordPress的函数,用来过滤分类的基本字符串,这是分类存档页面的URL的一部分: 这个函数可以用来修改基础字符串为一个不同的值,例如将自定义文章类型的”类别”改为”主题”。

过滤分类法的URL基础。

要删除任何手动预设的/index.php/。

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

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 18:32:58

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: