post_class
apply_filters( ‘post_class’, string[] $classes , string[] $class , int $post_id )
过滤钩子:过滤当前文章的CSS类名列表。
Filter Hook: Filters the list of CSS class names for the current post.
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$classes | (string[]) | 后置类名数组。 |
$class | (string[]) | 添加到日志中的其他类名数组。 |
$post_id | (int) | 邮政编码。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.7.0 | wp-includes/post-template.php:579 | 1 | 0 |
笔记(Notes)
后期处理表行的自定义类。
每当调用get_post_class($class,$post_id)函数时,都会调用过滤器。它在函数的末尾调用。
post_class 为WP2原创文章,链接:https://www.wp2.cn/hook/post_class-2/