Created
September 7, 2014 01:40
-
-
Save amdrew/da48b8f18eb9afa777e0 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Disallow admins from logging in via the login form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sumobi_edd_login_form_restrict( $redirect, $user_id ) { | |
if ( current_user_can( 'manage_options' ) ) { | |
wp_logout(); | |
edd_set_error( 'admin_login_disabled', __( 'Admins cannot login via this form', 'edd' ) ); | |
} | |
return $redirect; | |
} | |
add_filter( 'edd_login_redirect', 'sumobi_edd_login_form_restrict', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment