An open API service indexing awesome lists of open source software.

https://github.com/underpin-wp/menu-loader

WordPress Navigation Menu loader for Underpin
https://github.com/underpin-wp/menu-loader

menu underpin wordpress

Last synced: about 2 months ago
JSON representation

WordPress Navigation Menu loader for Underpin

Awesome Lists containing this project

README

          

# Underpin Menu Loader

Loader That assists with adding navigation menus to a WordPress website.

## Installation

### Using Composer

`composer require underpin/menu-loader`

### Manually

This plugin uses a built-in autoloader, so as long as it is required _before_
Underpin, it should work as-expected.

`require_once(__DIR__ . '/underpin-menus/menus.php');`

## Setup

1. Install Underpin. See [Underpin Docs](https://www.github.com/underpin-wp/underpin)
1. Register new menus as-needed.

## Example

A very basic example could look something like this.

```php
// Register menu
underpin()->menus()->add( 'example-menu', [
'name' => underpin()->__( 'translate-able name' ), // required. Fills "description" in register_nav_menu
'location' => 'example-menu' // Required. See register_nav_menu
] );
```

Alternatively, you can extend `Menu` and reference the extended class directly, like so:

```php
underpin()->menus()->add('menu-key','Namespace\To\Class');
```