get_the_modified_author()获取最后修改当前文章/页面的用户

目录

描述

Retrieve the author who last edited the current post.

get_the_modified_author() 描述

用法

<?php echo get_the_modified_author(); ?>

get_the_modified_author() 用法

返回值

(string) 

The author's display name.

get_the_modified_author() 返回值

源文件

get_the_modified_author() 函数的代码位于 wp-includes/author-template.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Retrieve the author who last edited the current post.
 *
 * @since 2.8.0
 *
 * @return string|void The author's display name.
 */
function get_the_modified_author() {
	if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) {
		$last_user = get_userdata($last_id);

		/**
		 * Filter the display name of the author who last edited the current post.
		 *
		 * @since 2.8.0
		 *
		 * @param string $last_user->display_name The author's display name.
		 */
		return apply_filters('the_modified_author', $last_user->display_name);
	}
}

get_the_modified_author() 源文件

相关