wp_redirect

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

wp_redirect:這是 WordPress 中的一個函式,它的作用是在 PHP 程式碼執行完成後重定向到另一個頁面。使用這個函式,開發者可以實現頁面的重定向,以達到跳轉到另一個頁面的目的。

過濾重定向的位置。

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

常見問題

FAQs
檢視更多 >