redirect_post_location

過濾鉤子
apply_filters( 'redirect_post_location', $location, $post_id )
引數
  • (string) $location The destination URL.
    Required:
  • (int) $post_id The post ID.
    Required:
定義位置
相關勾子
redirect_term_locationedit_post_linkpreview_post_linkredirect_canonicalwp_redirect_status
相關方法
redirect_postwp_redirect_admin_locationsedit_post_linkredirect_canonicalget_edit_post_linkwp_refresh_post_lock
引入
2.9.0
棄用
-

redirect_post_location 是一個動作,當WordPress網站重定向一個文章的位置時被觸發。這個鉤子通常被外掛或主題開發者用來修改文章重定向的行為。

過濾文章重定向的目標URL。

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

常見問題

FAQs
檢視更多 >