-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
39 lines (31 loc) · 1.06 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
Plugin Name: Understrap Multilevel Nav Menu
Plugin URI: https://understrap.com
Description: Create multiple level dropdown navigation menu's
Author: Howard Development & Consulting
Author URI: https://howarddc.com/
Version: 1.0
Text Domain: understrap-multilevel-menu
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
defined( 'ABSPATH' ) || exit;
require_once dirname( __FILE__ ) . '/understrap-multilevel-bootstrap-nav-walker.php';
function understrap_load_scripts() {
wp_enqueue_script( 'understrap-multilevel-nav-menu', plugin_dir_url( __FILE__ ). 'js/understrap-multilevel-dropdown.min.js', array('jquery'), 1.0, true );
}
add_action('wp_enqueue_scripts', 'understrap_load_scripts');
/**
* Updates the depth for our primary nav menu.
*
* @param array $args Array of wp_nav_menu() arguments.
* @return array
*/
function understrap_update_nav_menu_args( $args ) {
if ( 'primary' === $args['theme_location'] ) {
$args['depth'] = 3;
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'understrap_update_nav_menu_args' );