Skip to content

Commit

Permalink
Displaying updated time instead of creation time in Notepad Dashboard…
Browse files Browse the repository at this point in the history
… Widget
  • Loading branch information
TheCrowned committed May 28, 2018
1 parent 0121284 commit b8ad6a4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/dashboard/widgets/dashboard-notepad.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<span id="dashboard-notepad-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 ) ) . '</span>';
$last_updated = '<span id="dashboard-notepad-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 ) ) . '</span>';
else
$last_updated = '';

Expand Down Expand Up @@ -112,4 +112,4 @@ public function notepad_widget() {
}
}

}
}

0 comments on commit b8ad6a4

Please sign in to comment.