Filter hook 'comments_per_page'

in WP Core File wp-admin/includes/class-wp-screen.php at line 1258

View Source

comments_per_page

Filter Hook
Description
Renders the items per page option.

Hook Information

File Location wp-admin/includes/class-wp-screen.php View on GitHub
Hook Type Filter
Line Number 1258

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into comments_per_page
add_filter('comments_per_page', 'my_custom_filter');

function my_custom_filter() {
    // Your custom filtering logic here
    return 'modified_value';
}

Source Code Context

wp-admin/includes/class-wp-screen.php:1258 - How this hook is used in WordPress core
<?php
1253  
1254  		if ( 'edit_comments_per_page' === $option ) {
1255  			$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
1256  
1257  			/** This filter is documented in wp-admin/includes/class-wp-comments-list-table.php */
1258  			$per_page = apply_filters( 'comments_per_page', $per_page, $comment_status );
1259  		} elseif ( 'categories_per_page' === $option ) {
1260  			/** This filter is documented in wp-admin/includes/class-wp-terms-list-table.php */
1261  			$per_page = apply_filters( 'edit_categories_per_page', $per_page );
1262  		} else {
1263  			/** This filter is documented in wp-admin/includes/class-wp-list-table.php */

PHP Documentation

<?php
/**
	 * Renders the items per page option.
	 *
	 * @since 3.3.0
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 0
  • File: wp-admin/includes/class-wp-screen.php
Related Hooks

Related hooks will be displayed here in future updates.