admin管理员组文章数量:1292325
Hi community i create a custom post type "message". The posts are created from front-end by user by filling a form. i want on admin side when admin access this post and click on post title in table it should not go to default edit screen. it should go to another page in dashboard where this post details shown. any help please i am stuck on that. how could i redirect to that page and get post.
Hi community i create a custom post type "message". The posts are created from front-end by user by filling a form. i want on admin side when admin access this post and click on post title in table it should not go to default edit screen. it should go to another page in dashboard where this post details shown. any help please i am stuck on that. how could i redirect to that page and get post.
Share Improve this question edited Aug 24, 2020 at 12:20 Arslan Afzal asked Aug 24, 2020 at 11:50 Arslan AfzalArslan Afzal 12 bronze badges1 Answer
Reset to default 0On functions.php
function disallowed_admin_pages() {
global $pagenow;
# Check current admin page.
if ( $pagenow == 'post.php' && isset( $_GET['post'] ) && $_GET['action'] == 'edit' && (get_post_type( $_GET['post']) =='Post_type' )) {
wp_redirect( admin_url( '/edit.php?post_type=post_type&page=page_to_redirct&post='.$_GET['post'] ) );
exit;
}
}
add_action( 'admin_init', 'disallowed_admin_pages' );
page_to_redirect is already created an included in functions.php
本文标签: How can i redirect click to new admin page not to edit screen in post table
版权声明:本文标题:How can i redirect click to new admin page not to edit screen in post table 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741553956a2385041.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论