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

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

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

The canvas has been tainted by cross-origin data in chrome only -