Make WordPress Core


Ignore:
Timestamp:
07/29/2008 05:22:58 AM (16 years ago)
Author:
ryan
Message:

Use get_edit_post_link() instead of hardcoding edit links. Props mdawaffe. fixes #7425

File:
1 edited

Legend:

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

    r8033 r8484  
    2323    } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    2424        if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
    25             $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "post.php?action=edit&post=$post_ID&message=1" );
     25            $location = add_query_arg( array(
     26                '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
     27                'message' => 1
     28            ), get_edit_post_link( $post_ID, 'url' ) );
    2629        else
    27             $location = "post.php?action=edit&post=$post_ID&message=4";
     30            $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
    2831    } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
    2932        $location = add_query_arg( 'message', 2, wp_get_referer() );
     
    4851        $location = 'attachments.php';
    4952    } else {
    50         $location = "post.php?action=edit&post=$post_ID&message=4";
     53        $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
    5154    }
    5255
Note: See TracChangeset for help on using the changeset viewer.