Skip to content

Instantly share code, notes, and snippets.

@GhostToast
Created December 3, 2013 17:15
Show Gist options
  • Select an option

  • Save GhostToast/7773271 to your computer and use it in GitHub Desktop.

Select an option

Save GhostToast/7773271 to your computer and use it in GitHub Desktop.
Increase the posts per page in WordPress menu panel
<?php
/*
Plugin Name: Mstar Menu Limit
Description: Increase the posts per page in menu panel
Plugin URI: http://ghosttoa.st
Author: Gustave F. Gerhardt
Author URI: http://ghosttoa.st
License: GPL2
Version: .9
*/
function mstar_menu_limit( $query ) {
if (!is_admin()) {
return;
}
$screen = get_current_screen();
if(!empty($screen) && $screen->base == 'nav-menus'){
$query->set( 'posts_per_page', 100 );
}
return;
}
add_action( 'pre_get_posts', 'mstar_menu_limit', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment