Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r14815 r17228  
    5252 */
    5353function redirect_post($post_id = '') {
    54     if ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
    55         if ( isset($_POST['saveasdraft']) )
    56             $location = 'sidebar.php?a=c';
    57         elseif ( isset($_POST['publish']) )
    58             $location = 'sidebar.php?a=b';
    59     } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
     54    if ( isset($_POST['save']) || isset($_POST['publish']) ) {
    6055        $status = get_post_status( $post_id );
    6156
     
    9186
    9287    wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
     88    exit;
    9389}
    9490
     
    144140
    145141    if ( empty( $post_id ) ) {
    146         wp_redirect("post.php");
     142        wp_redirect( admin_url('post.php') );
    147143        exit();
    148144    }
     
    167163        $submenu_file = "edit.php";
    168164    } else {
    169         $parent_file = "edit.php?post_type=$post_type";
     165        if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
     166            $parent_file = $post_type_object->show_in_menu;
     167        else
     168            $parent_file = "edit.php?post_type=$post_type";
    170169        $submenu_file = "edit.php?post_type=$post_type";
    171170    }
     
    271270
    272271default:
    273         wp_redirect('edit.php');
     272    wp_redirect( admin_url('edit.php') );
    274273    exit();
    275274    break;
Note: See TracChangeset for help on using the changeset viewer.