edit_attachment_per_page
Filters the number of items per page to show for a specific 'per_page' type.
Это один из вариантов динамического хука edit_(post_type)_per_page
Использование
add_filter( 'edit_attachment_per_page', 'wp_kama_edit_attachment_per_page_filter' );
/**
* Function for `edit_attachment_per_page` filter-hook.
*
* @param int $posts_per_page Number of posts to display per page for the given post type.
*
* @return int
*/
function wp_kama_edit_attachment_per_page_filter( $posts_per_page ){
// filter...
return $posts_per_page;
}
- $posts_per_page(int)
- Number of posts to display per page for the given post type.
По умолчанию: 20
Список изменений
| С версии 3.0.0 | Введена. |
Где вызывается хук
edit_attachment_per_page
wp-admin/includes/post.php 1285
$posts_per_page = apply_filters( "edit_{$post_type}_per_page", $posts_per_page );