0
後重定向到edit.php我已經創建了新的自定義文章類型 - wordpress中的交易,它重新定向到edit.php(職位列表)發佈新交易後。所以我想重定向到交易列表頁面(http://mydemo.com/demo/edit.php?post_type=deals),所以請幫助我。我的自定義文章類型重定向到wordpress後發佈和更新發布
我試過這個代碼,但它將所有的帖子類型重定向到指定的頁面。
add_filter('redirect_post_location', 'wpse_124132_redirect_post_location');
/**
* Redirect to the edit.php on post save or publish.
*/
function wpse_124132_redirect_post_location($location) {
if (isset($_POST['save']) || isset($_POST['publish']))
return admin_url("edit.php?post_type=deals");
return $location;
}