创建/编辑帖子并自动重定向回列表页面

时间:2011-02-07 作者:Zack

是否有任何方法可以强制重定向到post(类型)列表页(edit.php?post_type=<post-type>)?

EDIT: 既然我有一个LMGTFY链接,在我否决之前,让我澄清一下

Is there anyway to redirect the user forcibly to the post type\'s listing page AFTER they\'ve already submitted the form to either edit the post or create a new post?

1 个回复
最合适的回答,由SO网友:Rarst 整理而成

全球$post$post_type 检查您的CPT

  • Post Status Transitions 钩子可以重定向到特定的岗位变更
  • wp_redirect().
  • 结束

    相关推荐

    Slug is redirecting to 404

    我有一个页面叫做菜谱。我将其更改为Recipes\\u old并更改了slug,以便创建一个新的Recipes页面。当我创建新配方页面时,slug被正确定义为/Recipes/但我无法访问该页面,WordPress正在将所有请求重定向到/Recipes\\u old/如何删除重定向?我已经删除了Recipes\\u old和Recipes。不过,slug仍在重定向。