php - Count Number of Revisions for a Wordpress Post -


i display number of revisions specific wordpress post. example, if post id "78" updated 8 times, echo number "8" in php.

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 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c# - Avoiding duplicate methods for Task and Task<T> -

javascript - Which segment of a polyline was clicked? -