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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

On 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