WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #41508


Ignore:
Timestamp:
09/19/2017 02:33:11 AM (2 years ago)
Author:
welcher
Comment:

@Compute thanks for the report!

In this case, I think that this is expected behavior. $items is a list of IDs as returned by get_objects_in_term( $menu->term_id, 'nav_menu' ); Because we are using a list of post ID's, it makes sense IMO that we would only want the number of posts that are represented in that returned list.

We can't ask for more posts as the list is passed to the posts__in arg which will only retrieve those post ID's. Passing a higher number than that list contains to posts_per_page will not return more posts and if it did, what would they be?

If we want less, there are already filters in place such as wp_get_nav_menu_items.

I don't see a use-case here but if you have one, please add it below and we can re-open

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #41508

    • Property Status changed from new to closed
    • Property Resolution changed from to invalid
    • Property Milestone changed from Awaiting Review to
  • Ticket #41508 – Description

    initial v1  
    1 When passing $args['posts_per_page'] to wp_get_nav_menu_items $args, it returns the same amount of items as if the argument was left out.
     1When passing `$args['posts_per_page']` to wp_get_nav_menu_items $args, it returns the same amount of items as if the argument was left out.
    22
    33It seems like this is due to the following line: