[wp-trac] [WordPress Trac] #18282: Issue with admin page hierarchy in Menu admin

WordPress Trac noreply at wordpress.org
Fri Aug 25 14:54:32 UTC 2017


#18282: Issue with admin page hierarchy in Menu admin
-------------------------------------------+------------------------------
 Reporter:  hcceast                        |       Owner:
     Type:  defect (bug)                   |      Status:  reviewing
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Menus                          |     Version:  3.2.1
 Severity:  major                          |  Resolution:
 Keywords:  needs-patch needs-screenshots  |     Focuses:
-------------------------------------------+------------------------------

Comment (by danburzo):

 I found a somewhat simpler (more targeted) solution to disable pagination
 in these meta boxes, by placing a filter on the
 {{{nav_menu_meta_box_object}}} hook:

 {{{#!php
 <?php
   add_filter( 'nav_menu_meta_box_object', array( $this,
 'disable_pagination_in_menu_meta_box' ) );

   function disable_pagination_in_menu_meta_box($obj) {
     $obj->_default_query = array(
       'posts_per_page' => -1
     );
     return $obj;
   }
 ?>
 }}}

 Please be advised that this uses the private-looking `_default_query`, so
 your mileage may vary, but it worked very well for me.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/18282#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list