From 9ef31f7fd5b6068525242faf5a5bceb733454f1d Mon Sep 17 00:00:00 2001 From: cdCorey Date: Wed, 24 Jul 2013 10:25:55 -0500 Subject: [PATCH] Fixes bug that generates an empty "<>" when disabling container This allows you to disable wrapping the menu in a container altogether, as you can in wp_nav_menu. Also, minor grammar fix in the comment. --- features/wp-page-menu.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/features/wp-page-menu.php b/features/wp-page-menu.php index 25f7404..3fddb77 100755 --- a/features/wp-page-menu.php +++ b/features/wp-page-menu.php @@ -1,12 +1,14 @@ '; - $end = ''; + if ($args['container'] !== false) { + $start ='<'.$args['container'].(!empty($args['container_id'])? ' id="'.esc_attr($args['container_id']).'"': '' ).(!empty($args['container_class'])? ' class="'.esc_attr(str_replace( '{menu slug}', 'page', $args['container_class'])).'"': '' ).'>'; + $end = ''; + } + else $start = $end = ''; return preg_replace( '/^]*>(.*)<\/div>$/', $start.'\1'.$end, $menu ); }