本文整理汇总了PHP中Akismet::check_db_comment方法的典型用法代码示例。如果您正苦于以下问题:PHP Akismet::check_db_comment方法的具体用法?PHP Akismet::check_db_comment怎么用?PHP Akismet::check_db_comment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Akismet
的用法示例。
在下文中一共展示了Akismet::check_db_comment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
/**
* Checks one or more comments against the Akismet API.
*
* ## OPTIONS
* <comment_id>...
* : The ID(s) of the comment(s) to check.
*
* [--noaction]
* : Don't change the status of the comment. Just report what Akismet thinks it is.
*
* ## EXAMPLES
*
* wp akismet check 12345
*
* @alias comment-check
*/
public function check($args, $assoc_args)
{
foreach ($args as $comment_id) {
if (isset($assoc_args['noaction'])) {
// Check the comment, but don't reclassify it.
$api_response = Akismet::check_db_comment($comment_id, 'wp-cli');
} else {
$api_response = Akismet::recheck_comment($comment_id, 'wp-cli');
}
if ('true' === $api_response) {
WP_CLI::line(sprintf(__("Comment #%d is spam.", 'akismet'), $comment_id));
} else {
if ('false' === $api_response) {
WP_CLI::line(sprintf(__("Comment #%d is not spam.", 'akismet'), $comment_id));
} else {
if (false === $api_response) {
WP_CLI::error(__("Failed to connect to Akismet.", 'akismet'));
} else {
if (is_wp_error($api_response)) {
WP_CLI::warning(sprintf(__("Comment #%d could not be checked.", 'akismet'), $comment_id));
}
}
}
}
}
}
示例2: akismet_check_db_comment
function akismet_check_db_comment($id, $recheck_reason = 'recheck_queue')
{
_deprecated_function(__FUNCTION__, '3.0', 'Akismet::check_db_comment()');
return Akismet::check_db_comment($id, $recheck_reason);
}
示例3: akismet_check_db_comment
function akismet_check_db_comment($id, $recheck_reason = 'recheck_queue')
{
return Akismet::check_db_comment($id, $recheck_reason);
}