<?php esc_attr_e( 'Upgrade to Pro', 'bbp-core' ); ?>
' . esc_html__( 'Required constants missing.', 'bbp-core' ) . ''; } // Enqueue styles/scripts. if ( ! wp_style_is( 'elegant-icon', 'registered' ) ) { wp_register_style( 'elegant-icon', FORUMAX_VEND . '/elegant-icon/style.css' ); } if ( ! wp_script_is( 'bbpc-ajax', 'registered' ) ) { wp_register_script( 'bbpc-ajax', FORUMAX_FRONT_ASS . 'js/ajax.js', array( 'jquery' ), FORUMAX_VERSION, true ); } wp_enqueue_style( 'elegant-icon' ); wp_enqueue_script( 'bbpc-ajax' ); // Inline Styles $styles = ''; $id = '#' . $unique_id; if ( $forum_title_color ) { $styles .= "{$id} .single-forum-post-widget .post-title a { color: {$forum_title_color} !important; }"; } if ( $forum_title_hover_color ) { $styles .= "{$id} .single-forum-post-widget .post-title a:hover { color: {$forum_title_hover_color} !important; }"; $styles .= "{$id} .single-forum-post-widget:hover .post-title a { color: {$forum_title_hover_color} !important; }"; } if ( $forum_meta_color ) { $styles .= "{$id} .single-forum-post-widget .post-info .author, {$id} .single-forum-post-widget .post-info .post-time { color: {$forum_meta_color} !important; }"; } if ( $parent_forum_color ) { $styles .= "{$id} .post-content .post-category a { color: {$parent_forum_color} !important; }"; } if ( $parent_forum_color_hover ) { $styles .= "{$id} .post-content .post-category a:hover { color: {$parent_forum_color_hover} !important; }"; } if ( $card_bg_color ) { $styles .= "{$id} .single-forum-post-widget { background-color: {$card_bg_color} !important; }"; } if ( $filter_bar_bg_color ) { $styles .= "{$id} .post-filter-widget { background-color: {$filter_bar_bg_color} !important; }"; } if ( $active_filter_color ) { $styles .= "{$id} .single-filter-item a.data-active { color: {$active_filter_color} !important; }"; } if ( $reach_color ) { $styles .= "{$id} .post-reach > div { color: {$reach_color} !important; }"; } // Typography. if ( ! empty( $attributes['title_font_size'] ) ) { $size = absint( $attributes['title_font_size'] ); $styles .= "{$id} .single-forum-post-widget .post-title a { font-size: {$size}px !important; }"; } if ( ! empty( $attributes['meta_font_size'] ) ) { $size = absint( $attributes['meta_font_size'] ); $styles .= "{$id} .single-forum-post-widget .post-info > div { font-size: {$size}px !important; }"; } // Spacing. if ( ! empty( $attributes['card_border_radius'] ) ) { $radius = absint( $attributes['card_border_radius'] ); $styles .= "{$id} .single-forum-post-widget { border-radius: {$radius}px !important; }"; } if ( ! empty( $attributes['card_gap'] ) ) { $gap = absint( $attributes['card_gap'] ); $styles .= "{$id} .single-forum-post-widget { margin-top: {$gap}px !important; }"; } // Card hover disabled. if ( ! $enable_card_hover ) { $styles .= "{$id} .single-forum-post-widget:hover { transform: none !important; box-shadow: 0 1.6px 3.5px 0 #334d7226, 0 0.5px 1px 0 #334d721a !important; }"; $styles .= "{$id} .single-forum-post-widget:hover .post-title h6 a { color: inherit !important; }"; } // Responsive. if ( $hide_reach_mobile ) { $styles .= "@media (max-width: 768px) { {$id} .single-forum-post-widget .post-reach { display: none !important; } }"; } // Status badge styles. if ( $show_status_badge ) { $styles .= "{$id} .frmx-status-badge { display: inline-block !important; padding: 2px 10px !important; border-radius: 12px !important; font-size: 11px !important; font-weight: 600 !important; line-height: 1.5 !important; margin-left: 8px !important; vertical-align: middle !important; }"; $styles .= "{$id} .frmx-status-badge--open { background-color: #dcfce7 !important; color: #166534 !important; }"; $styles .= "{$id} .frmx-status-badge--closed { background-color: #fee2e2 !important; color: #991b1b !important; }"; $styles .= "{$id} .frmx-status-badge--resolved { background-color: #dbeafe !important; color: #1e40af !important; }"; } // Excerpt styles. if ( $show_excerpt ) { $styles .= "{$id} .frmx-topic-excerpt { font-size: 13px !important; color: #6b7280 !important; margin-top: 6px !important; line-height: 1.5 !important; }"; } // Load More button styles. if ( $load_more_enabled ) { $styles .= "{$id} .frmx-load-more-wrap { text-align: center !important; margin-top: 20px !important; }"; $styles .= "{$id} .frmx-load-more-btn { display: inline-block !important; padding: 10px 28px !important; background: #3b82f6 !important; color: #fff !important; border: none !important; border-radius: 6px !important; font-size: 14px !important; font-weight: 500 !important; cursor: pointer !important; transition: background 0.3s ease !important; text-decoration: none !important; }"; $styles .= "{$id} .frmx-load-more-btn:hover { background: #2563eb !important; }"; } // Query $query_args = array( 'post_type' => 'topic', 'posts_per_page' => $load_more_enabled ? -1 : $ppp2, 'order' => $order, 'orderby' => $orderby, ); // Forum ID filter (include). if ( ! empty( $forum_filter_ids ) ) { $include_ids = array_map( 'absint', array_filter( explode( ',', $forum_filter_ids ) ) ); if ( ! empty( $include_ids ) ) { $query_args['meta_query'][] = array( 'key' => '_bbp_forum_id', 'value' => $include_ids, 'compare' => 'IN', 'type' => 'NUMERIC', ); } } // Forum ID filter (exclude). if ( ! empty( $exclude_forum_ids ) ) { $exclude_ids = array_map( 'absint', array_filter( explode( ',', $exclude_forum_ids ) ) ); if ( ! empty( $exclude_ids ) ) { $query_args['meta_query'][] = array( 'key' => '_bbp_forum_id', 'value' => $exclude_ids, 'compare' => 'NOT IN', 'type' => 'NUMERIC', ); } } $topics = new WP_Query( $query_args ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'forum-post-widget', 'id' => $unique_id, ) ); $total_topics = $topics->post_count; ob_start(); // Output styles. if ( ! empty( $styles ) ) { echo ''; } ?>
data_id="">
have_posts() ) : $i = 0; while ( $topics->have_posts() ) : $topics->the_post(); $topic_id = $topics->posts[ $i ]->ID; $vote_count = get_post_meta( $topic_id, 'bbpv-votes', true ); // Safe get forum ID. $forum_id = function_exists( 'bbp_get_topic_forum_id' ) ? bbp_get_topic_forum_id() : 0; // Safe get forum title. $forum_title = ''; if ( function_exists( 'bbp_get_topic_forum_title' ) ) { $forum_title = bbp_get_topic_forum_title(); } elseif ( function_exists( 'bbp_get_forum_title' ) ) { $forum_title = bbp_get_forum_title( $forum_id ); } $hover_class = $enable_card_hover ? ' wow fadeInUp' : ''; ?>
= $ppp2 ) : ?> style="display: none !important;" data-frmx-hidden="1">

<?php esc_attr_e( 'User icon', 'bbp-core' ); ?> $topic_id, 'type' => 'name', ) ) ); } ?>
<?php esc_attr_e( 'Time icon', 'bbp-core' ); ?>
<?php esc_attr_e( 'Views icon', 'bbp-core' ); ?>
<?php esc_attr_e( 'Likes icon', 'bbp-core' ); ?>
<?php esc_attr_e( 'Replies icon', 'bbp-core' ); ?>
$ppp2 ) : ?>
$ppp2 ) : $load_more_js = ' jQuery(document).on("click", "#' . esc_js( $unique_id ) . ' .frmx-load-more-btn", function(e) { e.preventDefault(); var $wrapper = jQuery("#' . esc_js( $unique_id ) . '"); var perPage = parseInt(jQuery(this).attr("data-per-page"), 10) || 9; var $hidden = $wrapper.find("[data-frmx-hidden=1]"); $hidden.slice(0, perPage).each(function() { jQuery(this).removeAttr("style").removeAttr("data-frmx-hidden"); }); if ($wrapper.find("[data-frmx-hidden=1]").length === 0) { jQuery(this).parent().hide(); } }); '; wp_add_inline_script( 'bbpc-ajax', $load_more_js ); endif; ?>
Error rendering block: ' . esc_html( $e->getMessage() ) . ''; } } }