Skip to content

Instantly share code, notes, and snippets.

@WerdsWords
Created August 7, 2013 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WerdsWords/6170641 to your computer and use it in GitHub Desktop.
Save WerdsWords/6170641 to your computer and use it in GitHub Desktop.
#37: comments_per_page
<?php
/**
* Increase comments-per-page limit when viewing spam comments
*
* @see WP_Comments_List_Table::get_per_page(), WP_Screen::render_per_page_options()
*
* @param int $comments_per_page The number of comments to list per page.
* @param string $comment_status The current comment status view. Default is 'all'.
*
* @return int The filtered number of comments to list per page.
*/
function wpdocs_delete_more_spam_comments( $comments_per_page, $comment_status ) {
if ( 'spam' == $comment_status )
$comments_per_page = 50;
return $comments_per_page;
}
add_filter( 'comments_per_page', 'wpdocs_delete_more_spam_comments', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment