mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +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:
+6
-3
@@ -20,9 +20,12 @@ function redirect_page($page_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/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false )
|
||||
$location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "page.php?action=edit&post=$page_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( $page_ID, 'url' ) );
|
||||
else
|
||||
$location = "page.php?action=edit&post=$page_ID&message=4";
|
||||
$location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
|
||||
} elseif ($_POST['addmeta']) {
|
||||
$location = add_query_arg( 'message', 2, wp_get_referer() );
|
||||
$location = explode('#', $location);
|
||||
@@ -45,7 +48,7 @@ function redirect_page($page_ID) {
|
||||
} elseif ($action == 'editattachment') {
|
||||
$location = 'attachments.php';
|
||||
} else {
|
||||
$location = "page.php?action=edit&post=$page_ID&message=4";
|
||||
$location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
|
||||
}
|
||||
|
||||
wp_redirect($location);
|
||||
|
||||
Reference in New Issue
Block a user