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。

wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 15:09:50

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: