This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only display max mega menu if plugin is active.
- Loading branch information
andrewmbacon
committed
Jun 24, 2015
1 parent
57d6a6b
commit 75299f8
Showing
1 changed file
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
<?php | ||
$wp_customize->add_setting( 'navoption1', //Give it a SERIALIZED name (so all theme settings can live under one db record) | ||
array( | ||
'default' => 'drop', //Default setting/value to save | ||
'type' => 'option', //Is this an 'option' or a 'theme_mod'? | ||
'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting. | ||
'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? | ||
) | ||
); | ||
$wp_customize->add_control('navoption1', array( | ||
'type' => 'select', | ||
'label' => 'Navigation Option 1', | ||
'section' => 'nav', | ||
'choices' => array( | ||
'drop'=>'Dropdowns', | ||
'drop-multi' => 'Multi-level Dropdowns', | ||
'tabs'=>'Tabs', | ||
'maxmegamenu'=>'Maxmegamenu Dropdown', | ||
'left'=>'Left Only' | ||
) | ||
) | ||
); | ||
array( | ||
'default' => 'drop', //Default setting/value to save | ||
'type' => 'option', //Is this an 'option' or a 'theme_mod'? | ||
'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting. | ||
'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? | ||
) | ||
); | ||
|
||
|
||
// Setup Navigation options as an array | ||
$navStyleOptions = array( | ||
'drop'=>'Dropdowns', | ||
'drop-multi' => 'Multi-level Dropdowns', | ||
'tabs'=>'Tabs' | ||
); | ||
|
||
// Check to see if max mega menu is active | ||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | ||
$maxMegaMenuActive = is_plugin_active('megamenu/megamenu.php'); | ||
|
||
// If it's active, add that option to the array. | ||
if ($maxMegaMenuActive){ | ||
$navStyleOptions['maxmegamenu'] = 'Maxmegamenu Dropdown'; | ||
}; | ||
|
||
// create the nav style options using the array. | ||
$wp_customize->add_control('navoption1', array( | ||
'type' => 'select', | ||
'label' => 'Navigation Style', | ||
'section' => 'nav', | ||
'choices' => $navStyleOptions | ||
) | ||
); | ||
|
||
?> |