mirror of
https://github.com/10h30/trestle.git
synced 2026-06-05 15:09:35 +09:00
moved nav button functionality from functions.php into trestle-functions.php, fixed default Trestle options error that occurred when first activating Trestle
This commit is contained in:
+1
-4
@@ -79,12 +79,9 @@ function trestle_theme_setup() {
|
||||
* Auto & Mobile Navigation
|
||||
===========================================*/
|
||||
|
||||
// Implement auto-nav
|
||||
// Implement auto-nav and mobile nav button
|
||||
add_action( 'init', 'trestle_nav_modifications' );
|
||||
|
||||
// Add mobile nav button
|
||||
add_action( 'genesis_after_header', 'trestle_add_mobile_nav', 0 );
|
||||
|
||||
|
||||
/*===========================================
|
||||
* Actions & Filters
|
||||
|
||||
+5
-1
@@ -29,17 +29,21 @@ function trestle_custom_defaults( $defaults ) {
|
||||
$defaults[$k] = $v;
|
||||
|
||||
// Update actual options if they don't yet exist
|
||||
if ( !array_key_exists( $k, $options ) )
|
||||
if ( $options && !array_key_exists( $k, $options ) )
|
||||
$options[$k] = $v;
|
||||
|
||||
}
|
||||
update_option( GENESIS_SETTINGS_FIELD, $options );
|
||||
|
||||
//
|
||||
|
||||
// Return modified default array
|
||||
return $defaults;
|
||||
|
||||
}
|
||||
add_filter( 'genesis_theme_settings_defaults', 'trestle_custom_defaults' );
|
||||
|
||||
// Also perform
|
||||
|
||||
/**
|
||||
* Sanitization
|
||||
|
||||
@@ -200,6 +200,9 @@ function trestle_register_required_plugins() {
|
||||
|
||||
function trestle_nav_modifications() {
|
||||
|
||||
// Add mobile nav button
|
||||
add_action( 'genesis_after_header', 'trestle_add_mobile_nav', 0 );
|
||||
|
||||
// Auto-generate nav if Genesis theme setting is checked
|
||||
if ( 1 == genesis_get_option( 'trestle_auto_nav' ) ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user