Skip to content

Commit

Permalink
Move infinite scroll limit to 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Jun 15, 2023
1 parent 2709a85 commit c3ce556
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions performance/vip-tweaks.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,10 @@ function wpcom_vip_maybe_bust_available_months_cache( $post_id ) {
wp_cache_delete( $cache_key, 'vip' );
}
}

/**
* Set a max limit on posts_per_page for an infinite scroll request to prevent client-side abuse.
*/
add_filter( 'infinite_scroll_posts_per_page', function( $posts_per_page ) {
return min( (int) $posts_per_page, 1000 );
} );

0 comments on commit c3ce556

Please sign in to comment.