From d795f08d39ad741f7f8408efddab444d971f4ef9 Mon Sep 17 00:00:00 2001 From: Nick Freear Date: Wed, 21 Dec 2016 13:36:09 +0000 Subject: [PATCH] Bug #18, add `top_link` flag to `simple_menu` shortcode plugin [iet:7491556] --- simple_menu.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/simple_menu.php b/simple_menu.php index 6fd8402..d8d8e37 100644 --- a/simple_menu.php +++ b/simple_menu.php @@ -34,6 +34,7 @@ public function shortcode_simplemenu( $attr ) { 'sub' => NULL, 'content' => false, 'comments'=> false, + 'top_link'=> true, ], $attr ) ); $menu_obj = wp_get_nav_menu_object( $menu ); //232 ); //'Help' ); //'Main' ); @@ -60,7 +61,7 @@ public function shortcode_simplemenu( $attr ) { $classes = self::SHORTCODE . " menu-$menu sub-$sub"; if ( $content ) { - return $this->display_content( $sub_menu, $parent_id, $classes, $comments ); + return $this->display_content( $sub_menu, $parent_id, $classes, $comments, $top_link ); } return $this->display_menu( $sub_menu, $parent_id, $classes ); } @@ -88,7 +89,7 @@ protected function display_menu( $sub_menu, $menu_id, $classes ) { } - protected function display_content( $sub_menu, $menu_id, $classes, $show_comments = false ) { + protected function display_content( $sub_menu, $menu_id, $classes, $show_comments = false, $with_top_link = false ) { ob_start(); ?>
@@ -99,6 +100,9 @@ protected function display_content( $sub_menu, $menu_id, $classes, $show_comment

title ?>

object_id )) ?> object_id, $show_comments ) ?> + + Return to top of page +