From: Laury GvR Date: Fri, 29 Jul 2016 15:13:43 +0000 (-0400) Subject: Members only area implementation. Testing sidemenu X-Git-Tag: v1.0.0^2~225 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=cf4a37e960d687dd49fc229de08855b38de74612;p=WP-Themes%2Fpetoskeyarea.git Members only area implementation. Testing sidemenu Members only link and partials added. Members only sidemenu needs to be tested on dev55. --- diff --git a/functions.php b/functions.php index ac48333..ed7351a 100644 --- a/functions.php +++ b/functions.php @@ -78,6 +78,61 @@ function glm_site_scripts() } +if ( ! function_exists( 'glm_members_only_menu')) { + function glm_members_only_menu() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => 'members-only-menu', // class of container + 'menu' => '', // menu name + 'menu_class' => 'members-only-menu', // adding custom nav class + 'theme_location' => 'members-only-menu', // where it's located in the theme + 'before' => '', // before each link + 'after' => '', // after each link + 'link_before' => '', // before each link text + 'link_after' => '', // after each link text + 'depth' => 2, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'items_wrap' => '%3$s', + 'walker' => new GLM_Members_Only_Walker() + )); + } +} + +if ( ! class_exists( 'GLM_Members_Only_Walker' ) ) : +class GLM_Members_Only_Walker extends Walker_Nav_Menu { + + function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) { + $element->has_children = ! empty( $children_elements[ $element->ID ] ); + $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : ''; + $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'page_item_has_children' : ''; + $element->classes[] = 'page_item'; + + parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); + } + + function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) { + $item_html = ''; + parent::start_el( $item_html, $object, $depth, $args ); + + $classes = empty( $object->classes ) ? array() : (array) $object->classes; + + if ( in_array( 'label', $classes ) ) { + $item_html = preg_replace( '/]*>(.*)<\/a>/iU', '', $item_html ); + } + + $output .= $item_html; + } + + function start_lvl( &$output, $depth = 0, $args = array() ) { + $output .= "\n'; + } + +} +endif; /* Header for posts*/ function glm_get_header() { diff --git a/glm-members-only-template.php b/glm-members-only-template.php new file mode 100644 index 0000000..b883f8e --- /dev/null +++ b/glm-members-only-template.php @@ -0,0 +1,44 @@ + + +
+ +
+ +
+
+ +
+
+ +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ + diff --git a/parts/glm-members-only-login-form.php b/parts/glm-members-only-login-form.php new file mode 100644 index 0000000..f8cf1fe --- /dev/null +++ b/parts/glm-members-only-login-form.php @@ -0,0 +1,21 @@ + +
+ +
+ \ No newline at end of file diff --git a/parts/glm-members-only-lostpass-form.php b/parts/glm-members-only-lostpass-form.php new file mode 100644 index 0000000..296b1dd --- /dev/null +++ b/parts/glm-members-only-lostpass-form.php @@ -0,0 +1,25 @@ + + Lost Password? +
+ +

+ +

+ +
+

+

+ +

+ +

+
+
\ No newline at end of file diff --git a/parts/glm-members-only-top-bar.php b/parts/glm-members-only-top-bar.php new file mode 100644 index 0000000..bb67f35 --- /dev/null +++ b/parts/glm-members-only-top-bar.php @@ -0,0 +1,8 @@ +
+
Hello, user_login ?>.
+ Logout + + + Enter Admin Area + +
\ No newline at end of file diff --git a/parts/members-sidebar.php b/parts/members-sidebar.php new file mode 100644 index 0000000..da2e5a7 --- /dev/null +++ b/parts/members-sidebar.php @@ -0,0 +1,9 @@ + \ No newline at end of file