假设您的主题正在使用comment_class()
;
示例(将添加到主题的functions.php中):
add_filter( \'comment_class\', \'comment_class_logged_in_user\' );
function comment_class_logged_in_user( $classes ) {
global $comment;
if ( $comment->user_id > 0 && is_user_logged_in() ) {
global $current_user; get_currentuserinfo();
$logged_in_user = $current_user->ID;
if( $comment->user_id == $logged_in_user ) $classes[] = \'comment-author-logged-in\';
}
return $classes;
}
需要设置css类的格式:
.comment-author-logged-in { }
我最近发布了
plugin version in my site.