From 70aa9e12ebded928c144af5cad783ac059430fa9 Mon Sep 17 00:00:00 2001 From: westi Date: Mon, 3 May 2010 13:56:35 +0000 Subject: [PATCH] Fix the edit post link to cope with the change in behaviour of admin_url to always escape the url. See #13051. git-svn-id: http://svn.automattic.com/wordpress/trunk@14372 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 469627d77d..b37210e9b6 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -784,11 +784,6 @@ function get_edit_post_link( $id = 0, $context = 'display' ) { if ( !$post = &get_post( $id ) ) return; - if ( 'display' == $context ) - $action = '&action=edit'; - else - $action = '&action=edit'; - $post_type_object = get_post_type_object( $post->post_type ); if ( !$post_type_object ) return; @@ -796,7 +791,14 @@ function get_edit_post_link( $id = 0, $context = 'display' ) { if ( !current_user_can( $post_type_object->edit_cap, $post->ID ) ) return; - return apply_filters( 'get_edit_post_link', admin_url( sprintf($post_type_object->_edit_link . $action, $post->ID) ), $post->ID, $context ); + $url = admin_url( sprintf($post_type_object->_edit_link, $post->ID) ); + + if ( 'display' == $context ) + $url .= '&action=edit'; + else + $url .= '&action=edit'; + + return apply_filters( 'get_edit_post_link', $url , $post->ID, $context ); } /**