Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想显示特定 Wordpress 帖子的修订数量。例如,如果帖子 ID“78”被更新了 8 次,我想在 PHP 中回显数字“8”。
你可以试试这个:
$args = array( 'post_parent' => 78, // id 'post_type' => 'revision', 'post_status' => 'inherit' ); $query = get_children($args); echo count($query); // i.e. 7