wp/wp-admin/includes/class-wp-media-list-table.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
--- a/wp/wp-admin/includes/class-wp-media-list-table.php	Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-admin/includes/class-wp-media-list-table.php	Fri Sep 05 18:52:52 2025 +0200
@@ -503,15 +503,22 @@
 	 * Handles the author column output.
 	 *
 	 * @since 4.3.0
+	 * @since 6.8.0 Added fallback text when author's name is unknown.
 	 *
 	 * @param WP_Post $post The current WP_Post object.
 	 */
 	public function column_author( $post ) {
-		printf(
-			'<a href="%s">%s</a>',
-			esc_url( add_query_arg( array( 'author' => get_the_author_meta( 'ID' ) ), 'upload.php' ) ),
-			get_the_author()
-		);
+		$author = get_the_author();
+
+		if ( ! empty( $author ) ) {
+			printf(
+				'<a href="%s">%s</a>',
+				esc_url( add_query_arg( array( 'author' => get_the_author_meta( 'ID' ) ), 'upload.php' ) ),
+				esc_html( $author )
+			);
+		} else {
+			echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . __( '(no author)' ) . '</span>';
+		}
 	}
 
 	/**
@@ -708,6 +715,10 @@
 	}
 
 	/**
+	 * Generates the list table rows.
+	 *
+	 * @since 3.1.0
+	 *
 	 * @global WP_Post  $post     Global post object.
 	 * @global WP_Query $wp_query WordPress Query object.
 	 */