feat(widgets): comments CPT, tag scale, oneline filters + CSS
RecentComments uses aksrt_forum_topic/product + lazy avatars; TagCloud scale works; OnelinePosts topics/pay_type; batch34-36 residual CSS.
This commit is contained in:
@@ -56,10 +56,16 @@ class RecentCommentsWidget extends \WP_Widget {
|
||||
'orderby' => 'comment_date_gmt',
|
||||
'order' => 'DESC',
|
||||
];
|
||||
// Include forum topics when forum is active.
|
||||
if (post_type_exists('forum_topic') || post_type_exists('forum_post')) {
|
||||
// Include forum topics / products when active.
|
||||
if (post_type_exists('aksrt_forum_topic')) {
|
||||
$query['post_type'][] = 'aksrt_forum_topic';
|
||||
} elseif (post_type_exists('forum_topic') || post_type_exists('forum_post')) {
|
||||
// Legacy CPT names.
|
||||
$query['post_type'][] = post_type_exists('forum_topic') ? 'forum_topic' : 'forum_post';
|
||||
}
|
||||
if (post_type_exists('aksrt_product')) {
|
||||
$query['post_type'][] = 'aksrt_product';
|
||||
}
|
||||
if ($post_not_in) {
|
||||
$query['post__not_in'] = $post_not_in;
|
||||
}
|
||||
@@ -126,7 +132,8 @@ class RecentCommentsWidget extends \WP_Widget {
|
||||
$avatar_url = $user_id > 0 && function_exists('aksrt_get_avatar_url')
|
||||
? aksrt_get_avatar_url($user_id, ['size' => 42])
|
||||
: get_avatar_url($comment, ['size' => 42]);
|
||||
$avatar = '<div class="avatar-img"><img class="avatar" src="' . esc_url($avatar_url) . '" alt="" width="36" height="36" loading="lazy" /></div>';
|
||||
$ph = get_template_directory_uri() . '/assets/img/placeholder.svg';
|
||||
$avatar = '<div class="avatar-img"><img class="avatar aksrt-lazy lazyload" data-src="' . esc_url($avatar_url) . '" src="' . esc_url($ph) . '" alt="" width="36" height="36" loading="lazy" /></div>';
|
||||
}
|
||||
|
||||
$like = function_exists('aksrt_get_comment_like_html')
|
||||
|
||||
Reference in New Issue
Block a user