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
Post a Comment