From 9b0e279e82e2c43df64a8b06a1389fca8fa7f399 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 8 Jan 2015 00:26:22 +0000 Subject: [PATCH] In dashboard activity widget, display a front-end link if the user cannot edit the post. props UaMV, DrewAPicture. fixes #29025. Built from https://develop.svn.wordpress.org/trunk@31075 git-svn-id: http://core.svn.wordpress.org/trunk@31056 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/dashboard.php | 15 ++++++--------- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index bf37176bae..70bfa6e2a3 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -715,15 +715,12 @@ function wp_dashboard_recent_posts( $args ) { $relative = date_i18n( __( 'M jS' ), $time ); } - if ( current_user_can( 'edit_post', get_the_ID() ) ) { - /* translators: 1: relative date, 2: time, 3: post edit link, 4: post title */ - $format = __( '%1$s, %2$s %4$s' ); - printf( "
  • $format
  • ", $relative, get_the_time(), get_edit_post_link(), _draft_or_post_title() ); - } else { - /* translators: 1: relative date, 2: time, 3: post title */ - $format = __( '%1$s, %2$s %3$s' ); - printf( "
  • $format
  • ", $relative, get_the_time(), _draft_or_post_title() ); - } + // Use the post edit link for those who can edit, the permalink otherwise. + $recent_post_link = current_user_can( 'edit_post', get_the_ID() ) ? get_edit_post_link() : get_permalink(); + + /* translators: 1: relative date, 2: time, 3: post edit link or permalink, 4: post title */ + $format = __( '%1$s, %2$s %4$s' ); + printf( "
  • $format
  • ", $relative, get_the_time(), $recent_post_link, _draft_or_post_title() ); } echo ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index 336898b3b0..076293c19d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31074'; +$wp_version = '4.2-alpha-31075'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.