[wp-trac] [WordPress Trac] #18282: Issue with admin page hierarchy in Menu admin
WordPress Trac
noreply at wordpress.org
Mon Jun 22 19:50:46 UTC 2020
#18282: Issue with admin page hierarchy in Menu admin
-------------------------------------------+------------------------------
Reporter: hcceast | Owner: (none)
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 johnmadox):
Hello,
I am kinda new to wordpress and am building an online store by the help of
different videos.
Can you please explain where and how to add this code?
I would really appreciate if anyone could help me out.
Thanks
Replying to [comment:51 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:64>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list