• Hi,
    Can anyone tell me
    Is it possible to redirect to listing page after post save
    instead staying on same edit form?
    please let me know if anyone has done before.

    Regards
    Harshad

Viewing 1 replies (of 1 total)
  • Check out the redirect_post_location filter. Here’s a sample for a custom post type ‘school’ to redirect to the admin page after save:

    function my_redirect_after_save( $location, $post_id ) {
            if ( 'school' == get_post_type( $post_id ) ) {
                $location = admin_url( 'admin.php?page=schools' );
            }
            return $location;
        }
    
    add_filter( 'redirect_post_location', 'my_redirect_after_save' );
Viewing 1 replies (of 1 total)
  • The topic ‘Redirect to listing page after post save’ is closed to new replies.