diff --git a/functions.php b/functions.php index 5b88c2d..4a3bb88 100644 --- a/functions.php +++ b/functions.php @@ -96,15 +96,17 @@ add_action( 'after_setup_theme', 'magaziner_setup' ); /* Custom navigation /* ------------------------------------ */ -require_once 'functions/nav.php'; -$nav = new \AlxMedia\Nav(); -$nav->enqueue( - [ - 'script' => 'js/nav.js', - 'inline' => false, - ] -); -$nav->init(); +add_action( 'wp', function() { + require_once 'functions/nav.php'; + $nav = new \AlxMedia\Nav(); + $nav->enqueue( + [ + 'script' => 'js/nav.js', + 'inline' => false, + ] + ); + $nav->init(); +} ); /* Custom logo diff --git a/functions/nav.php b/functions/nav.php index a8733f2..cd3c028 100644 --- a/functions/nav.php +++ b/functions/nav.php @@ -46,7 +46,7 @@ class Nav { * * @var string */ - protected $handle_prefix = 'alexmedia-nav'; + protected $handle_prefix = 'alxmedia-nav'; /** * Init. @@ -56,6 +56,9 @@ class Nav { * @return void */ public function init() { + if ( apply_filters( 'alxmedia_disable_nav_mods', false ) ) { + return; + } add_filter( 'walker_nav_menu_start_el', [ $this, 'add_nav_sub_menu_buttons' ], 10, 4 ); add_filter( 'nav_menu_item_title', [ $this, 'nav_menu_item_title' ], 10, 4 ); } diff --git a/functions/updater/theme-updater.php b/functions/updater/theme-updater.php index 6d5f9e4..1d9d6c1 100644 --- a/functions/updater/theme-updater.php +++ b/functions/updater/theme-updater.php @@ -18,7 +18,7 @@ $updater = new EDD_Theme_Updater_Admin( 'remote_api_url' => 'https://alx.media', // Site where EDD is hosted 'item_name' => 'Magaziner', // Name of theme 'theme_slug' => 'magaziner', // Theme slug - 'version' => '3.0.8', // The current version of this theme + 'version' => '3.0.9', // The current version of this theme 'author' => 'AlxMedia', // The author of this theme 'download_id' => '', // Optional, used for generating a license renewal link 'renew_url' => '', // Optional, allows for a custom license renewal link diff --git a/readme.txt b/readme.txt index 3fef2e8..5997396 100644 --- a/readme.txt +++ b/readme.txt @@ -68,6 +68,9 @@ Source: http://pixabay.com/ == Changelog == += 3.0.9 - 2020-09-01 = +* Added option to disable custom navigation in child themes + = 3.0.8 - 2020-08-28 = * Improved a11y * Added new menu diff --git a/style.css b/style.css index 207c46c..c9203ed 100644 --- a/style.css +++ b/style.css @@ -1,7 +1,7 @@ /* Theme Name: Magaziner Theme URI: http://alx.media/themes/magaziner/ -Version: 3.0.8 +Version: 3.0.9 Requires at least: 5.0 Requires PHP: 5.6 Tested up to: 5.5