WordPress函数文档check_comment()

判断一个评论是否符合有效 描述 译文 check_comment()判断评论是否传递WordPress Com…

判断一个评论是否符合有效

描述

译文

check_comment()判断评论是否传递WordPress Comment_Moderation 的内部检验。

原文

check_comment() checks whether a comment passes internal checks set by WordPress Comment_Moderation.

用法

<?php
   check_comment
$author$email$url$comment$user_ip,
         
$user_agent$comment_type );
?>

参数

$author

(string) (必填) Comment author name.

默认值: None

$email

(string) (必填) Comment author email.

默认值: None

$url

(string) (必填) Comment author URL.

默认值: None

$comment

(string) (必填) Comment contents.

默认值: None

$user_ip

(string) (必填) Comment author IP address.

默认值: None

$user_agent

(string) (必填) Comment author user agent.

默认值: None

$comment_type

(string) (必填) Comment type (comment, trackback, or pingback).

默认值: None

返回值

(boolean) 

This function returns a single boolean value of either true or false.

Returns false if in Comment_Moderation:

  • The Administrator must approve all messages,
  • The number of external links is too high, or
  • Any banned word, name, URL, e-mail, or IP is found in any parameter except $comment_type.

Returns true if the Administrator does not have to approve all messages and:

  • $comment_type parameter is a trackback or pingback and part of the blogroll, or
  • $author and $email parameters have been approved previously.

Returns true in all other cases.

示例

Simple use case

注意

  • 使用到: $wpdb
  • 使用到: get_option()

历史

  • 添加于 版本: WordPress Version 1.2

源文件

check_comment() 函数的代码位于 wp-includes/comment.php.

  • 原文:http://codex.wordpress.org/Function_Reference/check_comment
类别:WordPress函数文档

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT