Ticket #37186: 37186.diff
File 37186.diff, 3.0 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/class-wp-media-list-table.php
474 474 } 475 475 476 476 if ( $parent ) { 477 $title = _draft_or_post_title( $post->post_parent );478 477 $parent_type = get_post_type_object( $parent->post_type ); 478 479 if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $post->post_parent ) ) { 480 $title = _draft_or_post_title( $post->post_parent ); 479 481 ?> 480 <strong> 481 <?php if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $post->post_parent ) ) { ?> 482 <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"> 483 <?php echo $title ?></a><?php 482 <strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"> 483 <?php echo $title ?></a></strong><?php 484 484 } else { 485 echo $title; 486 } ?></strong> 487 <br /> 488 <?php 485 _e( '(Private post)' ); 486 } 487 489 488 if ( $user_can_edit ): 490 489 $detach_url = add_query_arg( array( 491 490 'parent_post_id' => $post->post_parent, … … 493 492 '_wpnonce' => wp_create_nonce( 'bulk-' . $this->_args['plural'] ) 494 493 ), 'upload.php' ); 495 494 printf( 496 '< a href="%s" class="hide-if-no-js detach-from-parent" aria-label="%s">%s</a>',495 '<br /><a href="%s" class="hide-if-no-js detach-from-parent" aria-label="%s">%s</a>', 497 496 $detach_url, 498 497 /* translators: %s: title of the post the attachment is attached to */ 499 498 esc_attr( sprintf( __( 'Detach from “%s”' ), $title ) ), … … 501 500 ); 502 501 endif; 503 502 } else { 504 _e( '(Unattached)' ); ?> <br />503 _e( '(Unattached)' ); ?> 505 504 <?php if ( $user_can_edit ) { 506 505 $title = _draft_or_post_title( $post->post_parent ); 507 506 printf( 508 '< a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js" aria-label="%s">%s</a>',507 '<br /><a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js" aria-label="%s">%s</a>', 509 508 $post->ID, 510 509 /* translators: %s: attachment title */ 511 510 esc_attr( sprintf( __( 'Attach “%s” to existing content' ), $title ) ), -
src/wp-includes/media.php
3064 3064 $parent_type = get_post_type_object( $post_parent->post_type ); 3065 3065 if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) { 3066 3066 $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' ); 3067 $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); 3067 3068 } 3068 $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );3069 3069 } 3070 3070 3071 3071 $attached_file = get_attached_file( $attachment->ID );