當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Akismet::get_comment_history方法代碼示例

本文整理匯總了PHP中Akismet::get_comment_history方法的典型用法代碼示例。如果您正苦於以下問題:PHP Akismet::get_comment_history方法的具體用法?PHP Akismet::get_comment_history怎麽用?PHP Akismet::get_comment_history使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Akismet的用法示例。


在下文中一共展示了Akismet::get_comment_history方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: comment_status_meta_box

 public static function comment_status_meta_box($comment)
 {
     $history = Akismet::get_comment_history($comment->comment_ID);
     if ($history) {
         echo '<div class="akismet-history" style="margin: 13px;">';
         foreach ($history as $row) {
             $time = date('D d M Y @ h:i:m a', $row['time']) . ' GMT';
             echo '<div style="margin-bottom: 13px;"><span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf(esc_html__('%s ago', 'akismet'), human_time_diff($row['time'])) . '</span> - ';
             echo esc_html($row['message']) . '</div>';
         }
         echo '</div>';
     }
 }
開發者ID:valiror,項目名稱:sharingdais_demo1,代碼行數:13,代碼來源:class.akismet-admin.php

示例2: akismet_get_comment_history

function akismet_get_comment_history($comment_id)
{
    return Akismet::get_comment_history($comment_id);
}
開發者ID:TheHiddenHaku,項目名稱:fuzzy-waddle,代碼行數:4,代碼來源:wrapper.php

示例3: akismet_get_comment_history

function akismet_get_comment_history($comment_id)
{
    _deprecated_function(__FUNCTION__, '3.0', 'Akismet::get_comment_history()');
    return Akismet::get_comment_history($comment_id);
}
開發者ID:Didox,項目名稱:beminfinito,代碼行數:5,代碼來源:wrapper.php

示例4: comment_status_meta_box

 public static function comment_status_meta_box($comment)
 {
     $history = Akismet::get_comment_history($comment->comment_ID);
     if ($history) {
         echo '<div class="akismet-history" style="margin: 13px;">';
         foreach ($history as $row) {
             $time = date('D d M Y @ h:i:m a', $row['time']) . ' GMT';
             $message = '';
             if (!empty($row['message'])) {
                 // Old versions of Akismet stored the message as a literal string in the commentmeta.
                 // New versions don't do that for two reasons:
                 // 1) Save space.
                 // 2) The message can be translated into the current language of the blog, not stuck
                 //    in the language of the blog when the comment was made.
                 $message = $row['message'];
             }
             // If possible, use a current translation.
             switch ($row['event']) {
                 case 'recheck-spam':
                     $message = __('Akismet re-checked and caught this comment as spam.', 'akismet');
                     break;
                 case 'check-spam':
                     $message = __('Akismet caught this comment as spam.', 'akismet');
                     break;
                 case 'recheck-ham':
                     $message = __('Akismet re-checked and cleared this comment.', 'akismet');
                     break;
                 case 'check-ham':
                     $message = __('Akismet cleared this comment.', 'akismet');
                     break;
                 case 'wp-blacklisted':
                     $message = __('Comment was caught by wp_blacklist_check.', 'akismet');
                     break;
                 case 'report-spam':
                     if (isset($row['user'])) {
                         $message = sprintf(__('%s reported this comment as spam.', 'akismet'), $row['user']);
                     } else {
                         if (!$message) {
                             $message = __('This comment was reported as spam.', 'akismet');
                         }
                     }
                     break;
                 case 'report-ham':
                     if (isset($row['user'])) {
                         $message = sprintf(__('%s reported this comment as not spam.', 'akismet'), $row['user']);
                     } else {
                         if (!$message) {
                             $message = __('This comment was reported as not spam.', 'akismet');
                         }
                     }
                     break;
                 case 'cron-retry-spam':
                     $message = __('Akismet caught this comment as spam during an automatic retry.', 'akismet');
                     break;
                 case 'cron-retry-ham':
                     $message = __('Akismet cleared this comment during an automatic retry.', 'akismet');
                     break;
                 case 'check-error':
                     if (isset($row['meta'], $row['meta']['response'])) {
                         $message = sprintf(__('Akismet was unable to check this comment (response: %s) but will automatically retry later.', 'akismet'), $row['meta']['response']);
                     }
                     break;
                 case 'recheck-error':
                     if (isset($row['meta'], $row['meta']['response'])) {
                         $message = sprintf(__('Akismet was unable to recheck this comment (response: %s).', 'akismet'), $row['meta']['response']);
                     }
                     break;
                 default:
                     if (preg_match('/^status-changed/', $row['event'])) {
                         // Half of these used to be saved without the dash after 'status-changed'.
                         // See https://plugins.trac.wordpress.org/changeset/1150658/akismet/trunk
                         $new_status = preg_replace('/^status-changed-?/', '', $row['event']);
                         $message = sprintf(__('Comment status was changed to %s', 'akismet'), $new_status);
                     } else {
                         if (preg_match('/^status-/', $row['event'])) {
                             $new_status = preg_replace('/^status-/', '', $row['event']);
                             if (isset($row['user'])) {
                                 $message = sprintf(__('%1$s changed the comment status to %2$s.', 'akismet'), $row['user'], $new_status);
                             }
                         }
                     }
                     break;
             }
             echo '<div style="margin-bottom: 13px;">';
             echo '<span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf(esc_html__('%s ago', 'akismet'), human_time_diff($row['time'])) . '</span>';
             echo ' - ';
             echo esc_html($message);
             echo '</div>';
         }
         echo '</div>';
     }
 }
開發者ID:nakamuraagatha,項目名稱:reseptest,代碼行數:92,代碼來源:class.akismet-admin.php


注:本文中的Akismet::get_comment_history方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。