From 98b6f199ef8de2cc9b0063825d7646e4cc41eac6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 19 Oct 2020 20:43:34 +0000 Subject: [PATCH] Coding Standards: Fix WPCS issues in [49207]. See #46866. git-svn-id: https://develop.svn.wordpress.org/trunk@49209 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/media.php | 35 +++++++++++++++++++-------------- src/wp-includes/media.php | 3 ++- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 0859180d2c..e9c0815c85 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -3295,29 +3295,34 @@ function attachment_submitbox_metadata() { if ( $author->exists() ) { $uploaded_by_name = $author->display_name ? $author->display_name : $author->nickname; $uploaded_by_link = get_edit_user_link( $author->ID ); - } ?> + } + ?>
- - - - - + + + + +
- post_parent ) : + post_parent ) { $post_parent = get_post( $post->post_parent ); - if ( $post_parent ) : + if ( $post_parent ) { $uploaded_to_title = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); - $uploaded_to_link = get_edit_post_link( $post->post_parent, 'raw' ); ?> + $uploaded_to_link = get_edit_post_link( $post->post_parent, 'raw' ); + ?>
- - - + + + - +
- - +
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index a73544b588..3ea44eafaf 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -3809,7 +3809,8 @@ function wp_prepare_attachment_for_js( $attachment ) { $author = new WP_User( $attachment->post_author ); if ( $author->exists() ) { - $response['authorName'] = html_entity_decode( $author->display_name ? $author->display_name : $author->nickname, ENT_QUOTES, get_bloginfo( 'charset' ) ); + $author_name = $author->display_name ? $author->display_name : $author->nickname; + $response['authorName'] = html_entity_decode( $author_name, ENT_QUOTES, get_bloginfo( 'charset' ) ); $response['authorLink'] = get_edit_user_link( $author->ID ); } else { $response['authorName'] = __( '(no author)' );