upload_per_page
Filters the number of items to list per page when listing media items.
Usage
add_filter( 'upload_per_page', 'wp_kama_upload_per_page_filter' ); /** * Function for `upload_per_page` filter-hook. * * @param int $media_per_page Number of media to list. * * @return int */ function wp_kama_upload_per_page_filter( $media_per_page ){ // filter... return $media_per_page; }
- $media_per_page(int)
- Number of media to list.
Default: 20
Changelog
Since 2.9.0 | Introduced. |
Where the hook is called
upload_per_page
wp-admin/includes/post.php 1348
$q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page );