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/bbpress-config.php +2 -16 2.5.0 → 2.5.1 View file →
@@ -341,23 +341,8 @@
341 341 return apply_filters( 'forumax_bbp_get_topic_admin_links', $retval, $r, $args );
342 342 }
343 343 }
344 344
345 -/**
346 - * Enqueue the script for sorting bbPress replies
347 - */
348 -if ( ! function_exists( 'forumax_enqueue_bbp_replies_sorting_script' ) ) {
349 - /**
350 - * Enqueue replies sorting script.
351 - */
352 - function forumax_enqueue_bbp_replies_sorting_script() {
353 - wp_localize_script( 'bbp-replies-sorting', 'bbp_reply_ajax_obj', [
354 - 'ajax_url' => admin_url( 'admin-ajax.php' ),
355 - 'bbp_topic_id' => get_the_ID(),
356 - ] );
357 - }
358 - add_action( 'wp_enqueue_scripts', 'forumax_enqueue_bbp_replies_sorting_script' );
359 -}
360 345
361 346 if ( ! function_exists( 'forumax_ajax_sort_bbp_replies' ) ) {
362 347 /**
363 348 * AJAX handler for sorting replies.
@@ -382,9 +367,10 @@
382 367 'post_type' => bbp_get_reply_post_type(),
383 368 'orderby' => ( 'vote' === $sort ? 'meta_value_num' : 'date' ),
384 369 'order' => ( 'asc' === $sort ? 'ASC' : 'DESC' ),
385 370 'meta_key' => ( 'vote' === $sort ? 'bbp_voting_score' : '' ),
386 - 'posts_per_page' => -1,
371 + // Public endpoint: cap it so a huge topic can't be dumped in one request.
372 + 'posts_per_page' => (int) apply_filters( 'forumax_sort_replies_limit', 200, $topic_id ),
387 373 ];
388 374 if ( bbp_has_replies( $replies_args ) ) {
389 375 while ( bbp_replies() ) :
390 376 bbp_the_reply();