Use可以在下面使用此函数获取作者详细信息中的所有修订,并选中副本。
根据您的需要。
function get_all_revisions($post_id){
//get all revisions of particular Page Id & Post Id
$revision = wp_get_post_revisions($post_id);
$post_author_id = array();
foreach ($revision as $key => $value) {
// Check Id Already Exists in Array
if ( ! in_array($value->post_author, $post_author_id)) {
// Store Author Id
$post_author_id[] = $value->post_author;
$get_author[\'author_link\'] = get_author_posts_url($value->post_author); // Author Link
$get_author[\'author_name\'] = get_the_author_meta( \'display_name\', $value->post_author ); // Author Display Name
//Store All Author Details in Array
$get_author_group[] = $get_author;
}
}
return $get_author_group;
}
用法:
// 2 is page or post id
$all_revisions = get_all_revisions(2);
//print_r($all_revisions);
foreach ($all_revisions as $key => $value) {
echo $value[\'author_link\'].\'<br>\';
echo $value[\'author_name\'].\'<br>\';
}