From b8ad6a469779dbbea29d8dff05ead09fa541a0e1 Mon Sep 17 00:00:00 2001 From: Stefano Ottolenghi Date: Mon, 28 May 2018 09:37:23 +0200 Subject: [PATCH] Displaying updated time instead of creation time in Notepad Dashboard Widget --- modules/dashboard/widgets/dashboard-notepad.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/dashboard/widgets/dashboard-notepad.php b/modules/dashboard/widgets/dashboard-notepad.php index 3ee25bae2..b78971455 100644 --- a/modules/dashboard/widgets/dashboard-notepad.php +++ b/modules/dashboard/widgets/dashboard-notepad.php @@ -73,17 +73,17 @@ public function handle_notepad_update() { public function notepad_widget() { $args = array( - 'posts_per_page' => 1, - 'post_status' => 'draft', - 'post_type' => self::notepad_post_type, - ); + 'posts_per_page' => 1, + 'post_status' => 'draft', + 'post_type' => self::notepad_post_type, + ); $posts = get_posts( $args ); $current_note = ( ! empty( $posts[0]->post_content ) ) ? $posts[0]->post_content : ''; $current_id = ( ! empty( $posts[0]->ID ) ) ? $posts[0]->ID : 0; $current_post = ( ! empty( $posts[0] ) ) ? $posts[0] : false; - + if ( $current_post ) - $last_updated = '' . sprintf( __( '%1$s last updated on %2$s', 'edit-flow' ), get_user_by( 'id', $current_post->post_author )->display_name, get_the_time( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $current_post ) ) . ''; + $last_updated = '' . sprintf( __( '%1$s last updated on %2$s', 'edit-flow' ), get_user_by( 'id', $current_post->post_author )->display_name, get_the_modified_time( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $current_post ) ) . ''; else $last_updated = ''; @@ -112,4 +112,4 @@ public function notepad_widget() { } } -} \ No newline at end of file +}