Lumberjack\Config\Menus::register PHP Method

register() public static method

En-queue required assets
public static register ( string $action = 'init', integer $priority = 10 )
$action string The name of the action to hook into
$priority integer The priority to attach the action with
    public static function register($action = 'init', $priority = 10)
    {
        // Register the action
        add_action($action, function () {
            register_nav_menus(['main-nav' => __('Main Navigation')]);
        });
    }

Usage Example

Beispiel #1
0
use Lumberjack\Config\CustomTaxonomies;
use Lumberjack\Config\Menus;
use Lumberjack\Functions\Assets;
require_once 'autoload.php';
/**
 * ------------------
 * Core
 * ------------------
 */
// Set up the default Timber context & extend Twig for the site
new Site();
/**
 * ------------------
 * Config
 * ------------------
 */
// Register support of certain theme features
ThemeSupport::register();
// Register any custom post types
CustomPostTypes::register();
// Register any custom taxonomies
CustomTaxonomies::register();
// Register WordPress menus
Menus::register();
/**
 * ------------------
 * Functions
 * ------------------
 */
// Enqueue assets
Assets::load();