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
This commit is contained in:
westi 2010-05-03 13:56:35 +00:00
parent e13615c621
commit 70aa9e12eb
1 changed files with 8 additions and 6 deletions

View File

@ -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 );
}
/**