Plugin Directory

Changeset 2028904


Ignore:
Timestamp:
02/12/2019 04:04:28 AM (7 years ago)
Author:
erwstout
Message:

Add menu by location endpoints

Location:
better-rest-endpoints/trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • better-rest-endpoints/trunk/CHANGELOG.md

    r2017898 r2028904  
    99
    1010n/a
     11
     12## [1.5.0] - 2019-02-11
     13
     14### Added
     15
     16- Endpoint to get menu by location
    1117
    1218## [1.4.1] - 2019-01-23
  • better-rest-endpoints/trunk/README.md

    r2017853 r2028904  
    252252- Yoast SEO Fields, if applicable
    253253
    254 ### Menus
     254### Menus from slug (name)
    255255**`better-rest-endpoints/v1/menus/{menu-slug}`**
    256256Gets a WordPress Menu by slug. Accepts no parameters.
    257257
    258258Returns the following JSON Response in each item object:
     259
     260- classes (array)
     261- description
     262- ID
     263- menu item parent
     264- menu_order
     265- slug
     266- target
     267- title
     268- url
     269
     270### Menus from location (theme location)
     271**`better-rest-endpoints/v1/menus/{menu-slug}`**
     272Gets a WordPress Menu by the theme location. Accepts no parameters.
     273
     274Returns an empty array if the location can not be found or if it has no assigned menu. Returns an array of the following objects if a menu is assigned to the specified location:
    259275
    260276- classes (array)
  • better-rest-endpoints/trunk/better-rest-endpoints.php

    r2017898 r2028904  
    108108        include_once self::$plugin_dir . 'includes/get_cpt_by_slug.php';
    109109
    110     // get custom post type by id
    111         include_once self::$plugin_dir . 'includes/wp_nav_menus.php';
     110        // get menus by menu name
     111        include_once self::$plugin_dir . 'includes/wp_nav_menus_by_name.php';
     112
     113        // get menus by menu location
     114        include_once self::$plugin_dir . 'includes/wp_nav_menus_by_location.php';
    112115
    113116        // get custom taxonomies
  • better-rest-endpoints/trunk/readme.txt

    r2017898 r2028904  
    4343== Changelog ==
    4444
     45= 1.5.0, Febuary 11, 2019
     46* Add: Functionality to get menus by location
     47
    4548= 1.4.1, January 23, 2019 =
    4649* Add: Functionality to get a page by slug or path for hierarchical pages
Note: See TracChangeset for help on using the changeset viewer.