PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.0
Forumax – AI Powered Advanced Community Forum Plugin v2.5.0
2.5.1 2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 All 31 releases
← All changes | includes/Elementor/inc/forum-ajax.php +12 -4 trunk → 2.5.0 View file →
@@ -17,14 +17,13 @@
17 17 function forumax_ajax_forum() {
18 18 check_ajax_referer( 'forumax-nonce', 'nonce' );
19 19
20 20 // received values from front end forum
21 - $data_forum = isset( $_POST['data_forum'] ) ? sanitize_text_field( wp_unslash( $_POST['data_forum'] ) ) : '';
21 + $data_forum = isset( $_POST['data_forum'] ) ? sanitize_text_field( $_POST['data_forum'] ) : '';
22 22
23 23 $args = [
24 24 'post_type' => 'topic',
25 25 'posts_per_page' => 9,
26 - 'no_found_rows' => true,
27 26 ];
28 27
29 28 if ( 'solved' === $data_forum ) {
30 29 $args['meta_query'] = [
@@ -100,10 +99,19 @@
100 99 } elseif ( 'featured' === $data_forum ) {
101 100
102 101 $super_stickies = bbp_get_super_stickies(); // Get global super sticky topics
103 102
104 - // Get sticky topics from all forums in one query.
105 - $stickies = forumax_get_all_forum_stickies( true );
103 + // Get sticky topics from all forums
104 + $stickies = [];
105 + $forums = get_posts( [
106 + 'post_type' => 'forum',
107 + 'posts_per_page' => -1,
108 + 'fields' => 'ids',
109 + ] );
110 +
111 + foreach ( $forums as $forum_id ) {
112 + $stickies = array_merge( $stickies, bbp_get_stickies( $forum_id ) );
113 + }
106 114
107 115 // Merge both sticky types
108 116 $sticky_topics = array_merge( $super_stickies, $stickies );
109 117 $sticky_topics = array_unique( $sticky_topics );