strict_redirect_guess_404_permalink

過濾鉤子
apply_filters( 'strict_redirect_guess_404_permalink', false )
引數
  • (bool) $strict_guess Whether to perform a strict guess. Default false (loose guess).
    Required:
定義位置
相關勾子
pre_redirect_guess_404_permalinkdo_redirect_guess_404_permalinkget_edit_user_linkget_edit_term_linkredirect_term_location
相關方法
redirect_guess_404_permalinkget_edit_user_linkget_the_permalinkget_edit_term_linkget_permalinkthe_permalink
引入
5.5.0
棄用
-

strict_redirect_guess_404_permalink: 一個WordPress的過濾器,可以用來修改redirect_guess_404_permalink函式的行為,當遇到404錯誤時,它被用來嘗試並找到一個有效的URL。這個過濾器可以用來改變該函式的工作方式,例如,返回一個自定義的URL,而不是試圖猜測一個固定地址。

過濾是否對404重定向進行嚴格猜測。

從過濾器返回一個Truthy值將只重定向準確的post_name匹配。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );
$strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );
$strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );

常見問題

FAQs
檢視更多 >