Skip to content

Commit c244c7e

Browse files
authored
Update reports.php (#255)
Bump limit as it's too low.
1 parent 1cabbc9 commit c244c7e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/wporg-5ftf/includes/reports.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ function enqueue_assets() {
5656
*/
5757
function render_company_report_page() {
5858

59-
$status = sanitize_title( $_GET['status'] );
59+
$status = sanitize_title( $_GET['status'] );
60+
$pledge_limit = 500;
6061

6162
if ( ! in_array( $status, array( 'draft', '5ftf-deactivated', 'publish' ) ) ) {
6263
$status = 'all';
@@ -65,13 +66,13 @@ function render_company_report_page() {
6566
$pledges = get_posts( array(
6667
'post_type' => '5ftf_pledge',
6768
'post_status' => $status,
68-
'posts_per_page' => 250, // set to 250 to avoid unexpected memory overuse.
69+
'posts_per_page' => $pledge_limit, // set to avoid unexpected memory overuse.
6970
'orderby' => 'post_title',
7071
'order' => 'ASC',
7172
) );
7273

7374
// Add visible warning on page if we hit the upper limit of the query.
74-
if ( 250 == count( $pledges ) ) {
75+
if ( count( $pledges ) === $pledge_limit ) {
7576
echo '<p>WARNING: pledge limit reached, check the code query.</p>';
7677
}
7778
?>

0 commit comments

Comments
 (0)