Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get menu by id name and slug #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on May 18, 2016

  1. Add slug field to menu items.

    As noted in unfulvio#18 it's helpfull to get the slug of the referenced
    object in some cases (e.g. custom routing).
    
    Now every item and possible children have an `object_slug` field.
    In case of custom links it just returns the items slug since the
    id refers to the item it self.
    
    Note that the v1 implementation isn't tested.
    
    Closes unfulvio#18
    fahrradflucht committed May 18, 2016
    Configuration menu
    Copy the full SHA
    b560f5c View commit details
    Browse the repository at this point in the history
  2. Add items argument to /menus.

    In some cases the cost of fetching the menus first and then only
    fetching the childs for the menus that are needed by id are higher
    then fetching them all at once. It's now possible to specify an
    `items` argument to indicate whether to fetch the menu items aswell
    or not.
    
    This could be also helpfull in cases like [this](https://wordpress.org/support/topic/get-menu-data-by-name-not-id) to filter on the client, although a `slug` argument to filter the menus array in addition would be need.
    
    Note that this change is currently V2 only.
    fahrradflucht committed May 18, 2016
    Configuration menu
    Copy the full SHA
    6b03a18 View commit details
    Browse the repository at this point in the history
  3. Change /menus/<id> to take ids names and slugs.

    Changed /menus/<id> to /menus/<menus> to take all supported param
    types of [wp_get_nav_menu_object](https://developer.wordpress.org/reference/functions/wp_get_nav_menu_object/) and [wp_get_nav_menu_items](https://developer.wordpress.org/reference/functions/wp_get_nav_menu_object/).
    This makes the slug filter argument suggested in 6b03a18 obsolete.
    
    Note that this is currently V2 only.
    fahrradflucht committed May 18, 2016
    Configuration menu
    Copy the full SHA
    479e74c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    442428b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    44259df View commit details
    Browse the repository at this point in the history