From 95d9264339a72e20efa167f975b31fef618b0783 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 2 Feb 2017 08:29:03 -0500 Subject: [PATCH] Updates for the login redirects and admin link. Moving these functions into the member plugin. Admin link now goes to main admin page. --- functions.php | 40 +----------------------------- parts/glm-members-only-top-bar.php | 4 +-- style.css | 2 +- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/functions.php b/functions.php index 6106c1e..ccd6ede 100644 --- a/functions.php +++ b/functions.php @@ -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' ); diff --git a/parts/glm-members-only-top-bar.php b/parts/glm-members-only-top-bar.php index bb67f35..ddf3e64 100644 --- a/parts/glm-members-only-top-bar.php +++ b/parts/glm-members-only-top-bar.php @@ -3,6 +3,6 @@ Logout - Enter Admin Area + Enter Admin Area - \ No newline at end of file + diff --git a/style.css b/style.css index 3710615..f9a6f82 100644 --- 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 */ -- 2.17.1