_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/。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _wp_filter_taxonomy_base( $base ) {
if ( ! empty( $base ) ) {
$base = preg_replace( '|^/index.php/|', '', $base );
$base = trim( $base, '/' );
}
return $base;
}
function _wp_filter_taxonomy_base( $base ) { if ( ! empty( $base ) ) { $base = preg_replace( '|^/index.php/|', '', $base ); $base = trim( $base, '/' ); } return $base; }
function _wp_filter_taxonomy_base( $base ) {
	if ( ! empty( $base ) ) {
		$base = preg_replace( '|^/index.php/|', '', $base );
		$base = trim( $base, '/' );
	}
	return $base;
}

常見問題

FAQs
檢視更多 >