Changeset 49207 for trunk/src/wp-includes/media.php
- Timestamp:
- 10/19/2020 08:27:34 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r49193 r49207 3810 3810 $author = new WP_User( $attachment->post_author ); 3811 3811 if ( $author->exists() ) { 3812 $response['authorName'] = html_entity_decode( $author->display_name, ENT_QUOTES, get_bloginfo( 'charset' ) ); 3812 $response['authorName'] = html_entity_decode( $author->display_name ? $author->display_name : $author->nickname, ENT_QUOTES, get_bloginfo( 'charset' ) ); 3813 $response['authorLink'] = get_edit_user_link( $author->ID ); 3813 3814 } else { 3814 3815 $response['authorName'] = __( '(no author)' ); … … 3817 3818 if ( $attachment->post_parent ) { 3818 3819 $post_parent = get_post( $attachment->post_parent ); 3819 } else { 3820 $post_parent = false; 3821 } 3822 3823 if ( $post_parent ) { 3824 $parent_type = get_post_type_object( $post_parent->post_type ); 3825 3826 if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) { 3827 $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' ); 3828 } 3829 3830 if ( $parent_type && current_user_can( 'read_post', $attachment->post_parent ) ) { 3820 if ( $post_parent ) { 3831 3821 $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); 3822 $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' ); 3832 3823 } 3833 3824 }
Note: See TracChangeset
for help on using the changeset viewer.