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.
1 Answer
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