I would like to display the number of revisions for a specific Wordpress post. For example, if the post ID "78" was updated 8 times, I would like to echo the number "8" in PHP.
Asked
Active
Viewed 517 times
0
-
it's better if you also could attach your code attempt here.. – Yohanes Khosiawan 许先汉 May 30 '14 at 04:36
1 Answers
0
You may try this:
$args = array(
'post_parent' => 78, // id
'post_type' => 'revision',
'post_status' => 'inherit'
);
$query = get_children($args);
echo count($query); // i.e. 7

The Alpha
- 143,660
- 29
- 287
- 307