Updates for the login redirects and admin link.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 2 Feb 2017 13:29:03 +0000 (08:29 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 2 Feb 2017 13:29:03 +0000 (08:29 -0500)
Moving these functions into the member plugin.
Admin link now goes to main admin page.

functions.php
parts/glm-members-only-top-bar.php
style.css

index 6106c1e..ccd6ede 100644 (file)
@@ -193,7 +193,7 @@ if ( ! function_exists( 'is_tree' ) ) {
 }
 add_action('thematic_searchloop', 'mytheme_search_loop');
 // End of the Contextual/Highlight Search functions
-// 
+//
 
 //function get_menu_parent_ID($menu_name){
 //    if(!isset($menu_name)){
@@ -245,44 +245,6 @@ if (!function_exists('is_in_tree')) {
     }
 }
 
-/**
- * Function Name:   front_end_login_fail.
- * Added for:       GLM Member DB front-end login failure custom redirection.
- * Description:     This redirects the failed login to the custom login page 
- *                  instead of default login page with a modified url
-**/
-add_action( 'wp_login_failed', 'front_end_login_fail' );
-function front_end_login_fail( $username ) {
-    // Getting URL of the login page
-    $referrer = $_SERVER['HTTP_REFERER'];    
-    // if there's a valid referrer, and it's not the default log-in screen
-    if( !empty( $referrer ) && !strstr( $referrer,'wp-login' ) && !strstr( $referrer,'wp-admin' ) ) {
-        echo get_permalink( get_option('glm_members_database_option_members_only_id') ) . "?login=failed"; 
-        wp_redirect( get_permalink( get_option('glm_members_database_option_members_only_id') ) . "?login=failed" ); 
-        exit;
-    }
-}
-
-/**
- * Function Name:   front_end_blank_credentials.
- * Added for:       GLM Member DB front-end login failure custom redirection.
- * Description:     This redirects to the custom login page if user name or 
- *                  password is empty with a modified url
-**/
-add_action( 'authenticate', 'front_end_blank_credentials', 1, 3);
-function front_end_blank_credentials( $login, $username, $password ) {
-
-    // Getting URL of the login page
-    $referrer = $_SERVER['HTTP_REFERER'];
-    // if there's a valid referrer, and it's not the default log-in screen
-    if( !empty( $referrer ) && !strstr( $referrer,'wp-login' ) && !strstr( $referrer,'wp-admin' ) ) { 
-        if( $username == "" || $password == "" ){
-            wp_redirect( get_permalink( get_option('glm_members_database_option_members_only_id') ) . "?login=empty" );
-            exit;
-        }
-    }
-}
-
 // Remove Yoast SEO Dashboard Widget
 function remove_wpseo_dashboard_overview() {
        remove_meta_box( 'wpseo-dashboard-overview', 'dashboard', 'normal' );
index bb67f35..ddf3e64 100644 (file)
@@ -3,6 +3,6 @@
     <a class='button glm-button' href="<?php echo wp_logout_url( home_url() ); ?>">Logout</a>
     <?php if (current_user_can("glm_members_member")) { ?>
         <?php apply_filters('glm_associate_terms', $glmAssociateTerms);?>
-        <a class='button glm-button' href='<?php echo get_admin_url() ?>admin.php?page=glm-members-admin-menu-member'>Enter <?php echo $glmAssociateTerms['term_member_cap']; ?> Admin Area</a>                        
+        <a class='button glm-button' href='<?php echo get_admin_url() ?>'>Enter <?php echo $glmAssociateTerms['term_member_cap']; ?> Admin Area</a>
     <?php } ?>
-</div>
\ No newline at end of file
+</div>
index 3710615..f9a6f82 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: ThinkDunes
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for ThinkDunes
-Version: 1.0.28
+Version: 1.0.29
 */