PHP code example of wpessential / wpessential-menus

1. Go to this page and download the library: Download wpessential/wpessential-menus library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wpessential / wpessential-menus example snippets


$menu = \WPEssential\Library\Menus::make();
$menu->add([
    'id'	=> 'primary_menu',
    'name'	=> esc_html__( 'Primary Menu', 'wpessential' ),
]);
$menu->init();

$menu = \WPEssential\Library\Menus::make();
$menu->adds([
    'primary_menu' => esc_html__( 'Primary Menu', 'wpessential' ),
    'footer_menu'  => esc_html__( 'Footer Menu', 'wpessential' ),
]);
$menu->init();

$menu = \WPEssential\Library\Menus::make();
$menu->remove('primary_menu');
$menu->init();

$menu = \WPEssential\Library\Menus::make();
$menu->removes(['primary_menu']);
$menu->init();