-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Login Button from Admin Login Page #174
Comments
@Poocey You can do that easily with the following code (maybe in theme's functions.php file) function remove_google_login_btn() {
$plugin = \RtCamp\GoogleLogin\plugin();
$login_instance = $plugin->container->get( 'login_flow' );
remove_action( 'login_form', [ $login_instance, 'login_button' ] );
}
add_action( 'init', 'remove_google_login_btn' ); Notice that we have a container that is managing instances of all the services (classes). You can call Let me know if it helps. Thanks. |
Unfortunately container is a private property and can't be accessed directly. Any recommendations? |
Sorry, you can directly use the container function to access container instance. $container = \RtCamp\GoogleLogin\container(); |
Thank you so much! That worked flawlessly. /**
|
By the way, after removing the login button on the wp-login.php page, I get this JS error: this.googleLoginButton is null (Cannot read properties of null (reading 'classList')). Looks like it's from this line of code: this.form.querySelector(".wp_google_login"),this.googleLoginButton.classList.remove("hidden") From this file: /wp-content/plugins/login-with-google/assets/build/js/login.js |
Any update here? Still getting js error: null is not an object (evaluating 'this.googleLoginButton.classList') |
How can we remove the login button from wp-login.php?
Turns out it's added here:
add_action( 'login_form', [ $this, 'login_button' ] );
But I've been unable to remove that action from login_form hook.
The text was updated successfully, but these errors were encountered: