new-user-approve
new-user-approve copied to clipboard
Fatal error
Hi i am using Wordpress 4. There is a ajax registration. and ajax callback function return this error. Fatal error: Call to undefined function login_header() @ plugins\new-user-approve\new-user-approve.php on line 620
@anup04sust Thanks for the bug report. Which plugin is causing this issue?
I also got that issue when I created a shortcut to display register form on a page. Seemed plugin does not work outsite login.php file also when register form display on a page, It will cause some issues when submit the form. I have switched to use another plugin for approve user.
@phplaw Do you know which plugin you were using to display the registration form on a page? I'd love to get this fixed.
@picklewagon I'm using my custom plugin from here https://github.com/phplaw/registration-page-shortcut
Error that I got
Fatal error: Call to undefined function login_header() in /www/wordpress/wp-content/plugins/new-user-approve/new-user-approve.php on line 617
This error occurred in the method show_user_pending_message
, I know that you hook to registration_errors
to show some messages from your plugin,
add_filter( 'registration_errors', array( $this, 'show_user_pending_message' ) );
Then display your plugin message on page with this code
login_header( __( 'Pending Approval', 'new-user-approve' ), '<p class="message register">' . $success_message . '</p>', $errors );
login_footer();
// an exit is necessary here so the normal process for user registration doesn't happen
exit();
I'm not sure this is good approach once registration process is outside wp-login.php
file where the method login_header
and login_footer
do not exists , also you call exit that will stop, terminate call to other plugin that has interactive with registration_errors
hook and user maybe miss some registration errors.