File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
plugins/wporg-5ftf/includes Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ function enqueue_assets() {
56
56
*/
57
57
function render_company_report_page () {
58
58
59
- $ status = sanitize_title ( $ _GET ['status ' ] );
59
+ $ status = sanitize_title ( $ _GET ['status ' ] );
60
+ $ pledge_limit = 500 ;
60
61
61
62
if ( ! in_array ( $ status , array ( 'draft ' , '5ftf-deactivated ' , 'publish ' ) ) ) {
62
63
$ status = 'all ' ;
@@ -65,13 +66,13 @@ function render_company_report_page() {
65
66
$ pledges = get_posts ( array (
66
67
'post_type ' => '5ftf_pledge ' ,
67
68
'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.
69
70
'orderby ' => 'post_title ' ,
70
71
'order ' => 'ASC ' ,
71
72
) );
72
73
73
74
// 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 ) {
75
76
echo '<p>WARNING: pledge limit reached, check the code query.</p> ' ;
76
77
}
77
78
?>
You can’t perform that action at this time.
0 commit comments