mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Use get_edit_post_link() instead of hardcoding edit links. Props mdawaffe. fixes #7425
git-svn-id: https://develop.svn.wordpress.org/trunk@8484 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -22,9 +22,12 @@ function redirect_post($post_ID = '') {
|
||||
$location = 'sidebar.php?a=b';
|
||||
} elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
|
||||
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 )
|
||||
$location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "post.php?action=edit&post=$post_ID&message=1" );
|
||||
$location = add_query_arg( array(
|
||||
'_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
|
||||
'message' => 1
|
||||
), get_edit_post_link( $post_ID, 'url' ) );
|
||||
else
|
||||
$location = "post.php?action=edit&post=$post_ID&message=4";
|
||||
$location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
|
||||
} elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
|
||||
$location = add_query_arg( 'message', 2, wp_get_referer() );
|
||||
$location = explode('#', $location);
|
||||
@@ -47,7 +50,7 @@ function redirect_post($post_ID = '') {
|
||||
} elseif ($action == 'editattachment') {
|
||||
$location = 'attachments.php';
|
||||
} else {
|
||||
$location = "post.php?action=edit&post=$post_ID&message=4";
|
||||
$location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
|
||||
}
|
||||
|
||||
wp_redirect( $location );
|
||||
|
||||
Reference in New Issue
Block a user