login_form action issues
-
Hi,
I’m trying to do some changes to the login page (wp-login.php)
I checked here (https://codex.www.ads-software.com/Plugin_API/Action_Reference/login_form) and tried to implement the example 2 (fixed from the bugs in variable names)
function my_translatorr2() { $your_content=ob_get_contents(); $your_content= preg_replace('/\<label for="user_login"\>(.*?)\<br/', 'Usernumia: ',$your_content); $your_content= preg_replace('/\<label for="user_pass"\>(.*?)\<br/', 'Passwiert:',$your_content); ob_get_clean(); echo $your_content; } add_action( 'login_form', 'my_translatorr2' );
For some reasons, ob_get_contents() is always returning an empty string.
Basically i’m trying to use this example and change it to include in the for more fields before the username and password. The reasoning based on this example was to get the form, prepend my content and then put back the content of the form…
Would anyone have any idea why ob_get_contents() is always empty?
I also tried
add_action( 'login_form', 'my_translatorr2', 99999 );
To make sure i’d be the last hook called but it didn’t help…
Any help or suggestion would be more than welcome…
Thanks
- The topic ‘login_form action issues’ is closed to new replies.