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/page.php

    r8033 r8484  
    2121    } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    2222        if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false )
    23             $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "page.php?action=edit&post=$page_ID&message=1" );
     23            $location = add_query_arg( array(
     24                '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
     25                'message' => 1
     26            ), get_edit_post_link( $page_ID, 'url' ) );
    2427        else
    25             $location = "page.php?action=edit&post=$page_ID&message=4";
     28            $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
    2629    } elseif ($_POST['addmeta']) {
    2730        $location = add_query_arg( 'message', 2, wp_get_referer() );
     
    4649        $location = 'attachments.php';
    4750    } else {
    48         $location = "page.php?action=edit&post=$page_ID&message=4";
     51        $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
    4952    }
    5053
Note: See TracChangeset for help on using the changeset viewer.