Fix notice and show generic last update message if _edit_last references a nonexistent user.
Fixes #15498. git-svn-id: https://develop.svn.wordpress.org/trunk@24816 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c7ef7b482b
commit
127c229182
@ -407,8 +407,7 @@ if ( post_type_supports($post_type, 'editor') ) {
|
|||||||
<?php
|
<?php
|
||||||
if ( 'auto-draft' != $post->post_status ) {
|
if ( 'auto-draft' != $post->post_status ) {
|
||||||
echo '<span id="last-edit">';
|
echo '<span id="last-edit">';
|
||||||
if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
|
if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
|
||||||
$last_user = get_userdata($last_id);
|
|
||||||
printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||||
} else {
|
} else {
|
||||||
printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||||
|
Loading…
Reference in New Issue
Block a user