Media: Ensure the attachment parent is accessible to the user before showing a link to it in the media manager.
Props johnbillion, peterwilsoncc. Built from https://develop.svn.wordpress.org/trunk@61884 git-svn-id: http://core.svn.wordpress.org/trunk@61166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -4568,7 +4568,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
|
||||
|
||||
if ( $attachment->post_parent ) {
|
||||
$post_parent = get_post( $attachment->post_parent );
|
||||
if ( $post_parent ) {
|
||||
if ( $post_parent && current_user_can( 'read_post', $attachment->post_parent ) ) {
|
||||
$response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );
|
||||
$response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' );
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '7.0-beta3-61883';
|
||||
$wp_version = '7.0-beta3-61884';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user