WordPress.org

Make WordPress Core

Ticket #29025: 29025.3.patch

File 29025.3.patch, 1.3 KB (added by michalzuber, 7 years ago)

Moved translator comment to context

  • src/wp-admin/includes/dashboard.php

    diff --git src/wp-admin/includes/dashboard.php src/wp-admin/includes/dashboard.php
    index 307a5f3..2a41f24 100644
    function wp_dashboard_recent_posts( $args ) { 
    715715                                $relative = date_i18n( __( 'M jS' ), $time );
    716716                        }
    717717
    718                         if ( current_user_can( 'edit_post', get_the_ID() ) ) {
    719                                 /* translators: 1: relative date, 2: time, 3: post edit link, 4: post title */
    720                                 $format = __( '<span>%1$s, %2$s</span> <a href="%3$s">%4$s</a>' );
    721                                 printf( "<li>$format</li>", $relative, get_the_time(), get_edit_post_link(), _draft_or_post_title() );
    722                         } else {
    723                                 /* translators: 1: relative date, 2: time, 3: post title */
    724                                 $format = __( '<span>%1$s, %2$s</span> %3$s' );
    725                                 printf( "<li>$format</li>", $relative, get_the_time(), _draft_or_post_title() );
    726                         }
     718                        // Use the post edit link for those who can edit, the permalink otherwise.
     719                        $recent_post_link = current_user_can( 'edit_post', get_the_ID() ) ? get_edit_post_link() : get_permalink();
     720
     721                        $format = _x( '<span>%1$s, %2$s</span> <a href="%3$s">%4$s</a>', '1: relative date, 2: time, 3: post edit link or permalink, 4: post title' );
     722                        printf( "<li>$format</li>", $relative, get_the_time(), $recent_post_link, _draft_or_post_title() );
    727723                }
    728724
    729725                echo '</ul>';