From 12ac770f89da1e171e346499f332b78533f8aee1 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 22 Jul 2015 10:59:35 -0400 Subject: [PATCH] Fix for errors also add new form page for side bar exclusion --- functions.php | 4 ++-- page.php | 5 +++- parts/nav-menu-dropdown.php | 46 ++++++++++++++++++------------------- parts/right-sidebar.php | 4 ++-- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/functions.php b/functions.php index 77d54cb..d397a97 100644 --- a/functions.php +++ b/functions.php @@ -222,8 +222,8 @@ function glm_side_menu() { } } } else { - $thisPageMenuId = $pageMenuId[0]->ID; - $thisPageMenuParent = $pageMenuId[0]->menu_item_parent; + $thisPageMenuId = (isset($pageMenuId[0])) ? $pageMenuId[0]->ID : 0; + $thisPageMenuParent = (isset($pageMenuId[0])) ? $pageMenuId[0]->menu_item_parent : 0; } // does the current page (in the menu) have sub menu items? if (isset($sideMenu[$thisPageMenuId]) && !empty($sideMenu[$thisPageMenuId])) { diff --git a/page.php b/page.php index 0fb9461..0fea665 100644 --- a/page.php +++ b/page.php @@ -2,7 +2,10 @@
- +
diff --git a/parts/nav-menu-dropdown.php b/parts/nav-menu-dropdown.php index 917b005..10597e5 100644 --- a/parts/nav-menu-dropdown.php +++ b/parts/nav-menu-dropdown.php @@ -10,31 +10,31 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License * */ - + class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu { - function start_lvl(&$output, $depth){ - $indent = str_repeat("\t", $depth); // don't output children opening tag (`
    `) - } + function start_lvl( &$output, $depth = 0, $args = array() ){ + $indent = str_repeat("\t", $depth); // don't output children opening tag (`
      `) + } - function end_lvl(&$output, $depth){ - $indent = str_repeat("\t", $depth); // don't output children closing tag - } + function end_lvl( &$output, $depth = 0, $args = array() ){ + $indent = str_repeat("\t", $depth); // don't output children closing tag + } - /** - * Start the element output. - * - * @param string $output Passed by reference. Used to append additional content. - * @param object $item Menu item data object. - * @param int $depth Depth of menu item. May be used for padding. - * @param array $args Additional strings. - * @return void - */ - function start_el(&$output, $item, $depth, $args) { - $url = '#' !== $item->url ? $item->url : ''; - $output .= '\n"; // replace closing with the option tag - } + function end_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0){ + $output .= "\n"; // replace closing with the option tag + } } diff --git a/parts/right-sidebar.php b/parts/right-sidebar.php index 2218182..61c4d2b 100644 --- a/parts/right-sidebar.php +++ b/parts/right-sidebar.php @@ -1,5 +1,5 @@
      - __( '

      Enter your Sidebar content here. Leave this area' . 'blank to remove the sidebar area.

      ', 'text-domain' ), @@ -7,4 +7,4 @@ echo get_the_block( 'sidebar', array( 'apply_filters' => true, ) ); ?> -

      \ No newline at end of file +
-- 2.17.1