comments_per_page хук-фильтрWP 2.6.0

Filters the number of comments listed per page in the comments list table.

Использование

add_filter( 'comments_per_page', 'wp_kama_comments_per_page_filter', 10, 2 );

/**
 * Function for `comments_per_page` filter-hook.
 * 
 * @param int    $comments_per_page The number of comments to list per page.
 * @param string $comment_status    The comment status name.
 *
 * @return int
 */
function wp_kama_comments_per_page_filter( $comments_per_page, $comment_status ){

	// filter...
	return $comments_per_page;
}
$comments_per_page(int)
The number of comments to list per page.
$comment_status(строка)
The comment status name.
По умолчанию: 'All'

Список изменений

С версии 2.6.0 Введена.

Где вызывается хук

WP_Comments_List_Table::get_per_page()
comments_per_page
WP_Screen::render_per_page_options()
comments_per_page
wp-admin/includes/class-wp-comments-list-table.php 211
return apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
wp-admin/includes/class-wp-screen.php 1258
$per_page = apply_filters( 'comments_per_page', $per_page, $comment_status );

Где используется хук в WordPress

Использование не найдено.