Changeset 60032
- Timestamp:
- 03/17/2025 06:52:12 PM (5 weeks ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r58745 r60032 504 504 * 505 505 * @since 4.3.0 506 * @since 6.8.0 Added fallback text when author's name is unknown. 506 507 * 507 508 * @param WP_Post $post The current WP_Post object. 508 509 */ 509 510 public function column_author( $post ) { 510 printf( 511 '<a href="%s">%s</a>', 512 esc_url( add_query_arg( array( 'author' => get_the_author_meta( 'ID' ) ), 'upload.php' ) ), 513 get_the_author() 514 ); 511 $author = get_the_author(); 512 513 if ( ! empty( $author ) ) { 514 printf( 515 '<a href="%s">%s</a>', 516 esc_url( add_query_arg( array( 'author' => get_the_author_meta( 'ID' ) ), 'upload.php' ) ), 517 esc_html( $author ) 518 ); 519 } else { 520 echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . __( '(no author)' ) . '</span>'; 521 } 515 522 } 516 523 -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r59000 r60032 1278 1278 * 1279 1279 * @since 4.3.0 1280 * @since 6.8.0 Added fallback text when author's name is unknown. 1280 1281 * 1281 1282 * @param WP_Post $post The current WP_Post object. 1282 1283 */ 1283 1284 public function column_author( $post ) { 1284 $args = array( 1285 'post_type' => $post->post_type, 1286 'author' => get_the_author_meta( 'ID' ), 1287 ); 1288 echo $this->get_edit_link( $args, get_the_author() ); 1285 $author = get_the_author(); 1286 1287 if ( ! empty( $author ) ) { 1288 $args = array( 1289 'post_type' => $post->post_type, 1290 'author' => get_the_author_meta( 'ID' ), 1291 ); 1292 echo $this->get_edit_link( $args, esc_html( $author ) ); 1293 } else { 1294 echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . __( '(no author)' ) . '</span>'; 1295 } 1289 1296 } 1290 1297
Note: See TracChangeset
for help on using the changeset viewer.