当前位置: 首页>>代码示例>>PHP>>正文


PHP Akismet_Admin::recheck_queue_portion方法代码示例

本文整理汇总了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'])));
     }
 }
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:35,代码来源:class.akismet-cli.php


注:本文中的Akismet_Admin::recheck_queue_portion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。