1. 首页
  2. WordPress 函数手册

get_comment_class()

get_comment_class( string|array $class = , int|WP_Comment $comment_id = null, int|WP_Post $post_id = null )

将comment div的类作为数组返回。
Returns the classes for the comment div as an array.

目录锚点:#参数#返回#源码


参数(Parameters)

参数 类型 必填 说明
$class (string | array) 可选 要添加到类列表中的一个或多个类。
$comment_id (int | WP_Comment) 可选 注释ID或WP_Comment对象。默认当前注释。
$post_id (int | WP_Post) 可选 Post ID或WP_Post对象。默认当前职位。

返回(Return)

(string[])类的数组。


源码(Source)


更新版本 源码位置 使用 被使用
4.4.0 wp-includes/comment-template.php:458 2 6

get_comment_class() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_comment_class/