wp_redirect_status

過濾鉤子
apply_filters( 'wp_redirect_status', $status, $location )
引數
  • (int) $status The HTTP response status code to use.
    Required:
  • (string) $location The path or URL to redirect to.
    Required:
定義位置
相關勾子
wp_redirectallowed_redirect_hostswp_set_comment_statuswp_editor_settingsredirect_post_location
相關方法
wp_redirectredirect_postwp_reset_postdata_wp_privacy_statuseswp_set_comment_statuswp_get_comment_status
引入
2.3.0
棄用
-

wp_redirect_status:這是 WordPress 中的一個鉤子,它可以用於自定義重定向的狀態碼。使用這個鉤子,開發者可以指定重定向的狀態碼,以便在瀏覽器中正確處理重定向。

過濾要使用的重定向HTTP響應狀態程式碼。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$status = apply_filters( 'wp_redirect_status', $status, $location );
$status = apply_filters( 'wp_redirect_status', $status, $location );
$status = apply_filters( 'wp_redirect_status', $status, $location );

常見問題

FAQs
檢視更多 >