本文整理汇总了PHP中Akismet_Admin::recheck_queue_portion方法的典型用法代码示例。如果您正苦于以下问题:PHP Akismet_Admin::recheck_queue_portion方法的具体用法?PHP Akismet_Admin::recheck_queue_portion怎么用?PHP Akismet_Admin::recheck_queue_portion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Akismet_Admin
的用法示例。
在下文中一共展示了Akismet_Admin::recheck_queue_portion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recheck_queue
/**
* Recheck all comments in the Pending queue.
*
* ## EXAMPLES
*
* wp akismet recheck_queue
*
* @alias recheck-queue
*/
public function recheck_queue()
{
$batch_size = 100;
$start = 0;
$total_counts = array();
do {
$result_counts = Akismet_Admin::recheck_queue_portion($start, $batch_size);
if ($result_counts['processed'] > 0) {
foreach ($result_counts as $key => $count) {
if (!isset($total_counts[$key])) {
$total_counts[$key] = $count;
} else {
$total_counts[$key] += $count;
}
}
$start += $batch_size;
$start -= $result_counts['spam'];
// These comments will have been removed from the queue.
}
} while ($result_counts['processed'] > 0);
WP_CLI::line(sprintf(_n("Processed %d comment.", "Processed %d comments.", $total_counts['processed'], 'akismet'), number_format($total_counts['processed'])));
WP_CLI::line(sprintf(_n("%d comment moved to Spam.", "%d comments moved to Spam.", $total_counts['spam'], 'akismet'), number_format($total_counts['spam'])));
if ($total_counts['error']) {
WP_CLI::line(sprintf(_n("%d comment could not be checked.", "%d comments could not be checked.", $total_counts['error'], 'akismet'), number_format($total_counts['error'])));
}
}