PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.1
Forumax – AI Powered Advanced Community Forum Plugin v2.5.1
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/admin/menu/Create_Forum.php +14 -4 2.4.2 → 2.5.1 View file →
@@ -27,12 +27,17 @@
27 27 wp_send_json_error( 'Forum title cannot be empty.' );
28 28 }
29 29
30 30 $args = [
31 - 'post_type' => 'forum',
32 - 'post_parent' => 0,
31 + 'post_type' => 'forum',
32 + 'post_parent' => 0,
33 + 'posts_per_page' => 1,
34 + 'fields' => 'ids',
35 + 'update_post_meta_cache' => false,
36 + 'update_post_term_cache' => false,
33 37 ];
34 38
39 + // Only the count is needed.
35 40 $query = new \WP_Query( $args );
36 41 $total = $query->found_posts;
37 42 $add = 2;
38 43 $order = $total + $add;
@@ -91,12 +96,17 @@
91 96 }
92 97
93 98 // Get order for the new sub-forum.
94 99 $args = [
95 - 'post_type' => 'forum',
96 - 'post_parent' => $parent_forum_id,
100 + 'post_type' => 'forum',
101 + 'post_parent' => $parent_forum_id,
102 + 'posts_per_page' => 1,
103 + 'fields' => 'ids',
104 + 'update_post_meta_cache' => false,
105 + 'update_post_term_cache' => false,
97 106 ];
98 107
108 + // Only the count is needed.
99 109 $query = new \WP_Query( $args );
100 110 $total = $query->found_posts;
101 111 $order = $total + 1;
102 112