функция
since 2.8.0
get_the_modified_author()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_the_modified_author( int|WP_Post|null $post = null ): string|null
Описание
Получает автора, последним отредактировавшего текущую запись.
Параметры
$post
int|WP_Post|null
необязательный
= null
ID записи или объект записи. По умолчанию — глобальный объект $post .
Возвращаемое значение
string|null
Исходный код
wp-includes/author-template.php:94
function get_the_modified_author( $post = null ) {
$post = get_post( $post );
if ( ! $post ) {
return null;
}
$last_id = get_post_meta( $post->ID, '_edit_last', true );
if ( ! $last_id ) {
return null;
}
$last_user = get_userdata( $last_id );
/**
* Filters the display name of the author who last edited the current post.
*
* @since 2.8.0
*
* @param string $display_name The author's display name, empty string if user is unavailable.
*/
return apply_filters( 'the_modified_author', $last_user ? $last_user->display_name : '' );
}
История изменений
| Версия | Описание |
|---|---|
| 6.9.0 | Added the $post parameter. Unknown return value is now explicitly null instead of void. |
| 2.8.0 | Introduced. |

