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: https://develop.svn.wordpress.org/trunk@14372 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cb10f6b4ae
commit
e20e62c135
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user