function tml_remove_footer_script() {
$tml = Theme_My_Login::get_object();
if ( $tml->is_action_page() && 'login' == $tml->request_action )
remove_action( 'wp_print_footer_scripts', array( &$tml, 'wp_print_footer_scripts' ) );
}
add_action( 'template_redirect', 'tml_remove_footer_script' );
Thanks for the help. Where do I put that code? I put it in theme-my-login-custom and it said it called an undefined function Theme_My_Login.
Put it in wp-plugins/theme-my-login-custom.php. Also, don’t forget opening <?php tag.
Would that code work in the theme functions.php as well?
Edit: Nope, it doesn’t 😀
No reason that it shouldn’t.
It gives a php error because it assumes the file containing the function in the same folder containing that script.
PHP Fatal error: Call to undefined method Theme_My_Login::is_action_page()
You’re using the exact code I posted before?
Yes, copied and pasted. What information do you need to narrow this down?
What file and line does it say the error originates from?
/wp-content/plugins/myFUNC/tmuFP.php on line 79
This is the file that contains the above code.
Why not put it in wp-content/plugins/theme-my-login-custom.php?
Because PHP Fatal error: Call to undefined method Theme_My_Login::is_action_page() in /is/path/wp-content/plugins/theme-my-login-custom.php on line 6.
This is line 6:
if ( $tml->is_action_page() && 'login' == $tml->request_action )
My appologies. I used the wrong method name. I confused myself with the new function name coming in 7.0. Try this instead.
function tml_remove_footer_script() {
$tml = Theme_My_Login::get_object();
if ( $tml->is_tml_page() && 'login' == $tml->request_action )
remove_action( 'wp_print_footer_scripts', array( &$tml, 'wp_print_footer_scripts' ) );
}
add_action( 'template_redirect', 'tml_remove_footer_script' );
That code doesn’t throw the error, also doesn’t give me a blank page front end, which is nice. Unfortunately it also does not suppress the input focus. It’s quite annoying because if you have your password saved, it automatically clears the username field and you have to put your username in even though it’s saved. Having that feature optional would be perfect.