50 posts per page in admin lists
The posts, pages and products lists show 50 items per page instead of 20. Each user can still change it under Screen Options.
<?php
add_action(
'admin_init',
static function () {
foreach ( get_post_types( array( 'show_ui' => true ) ) as $type ) {
add_filter(
"edit_{$type}_per_page",
static function ( $per_page ) use ( $type ) {
// Only when the user hasn't chosen a number themselves.
return get_user_option( "edit_{$type}_per_page" ) ? $per_page : 50;
}
);
}
}
);
In these packs
- More admin tweaks: Useful columns, a tidier admin bar, a welcome box for clients, and fewer menus for editors.