Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am customizing all the wp-login.php forms, i.e., login, lost password, register, etc.

I have a working model but when I decoded to toss in the default error messages on my custom forms I thought there must be a better way to make custom forms and still use wp-login.php to do all the heavy lifting and why write custom form validation when wp-login.php does it well enough?

I am building this as a plugin.

This is my working solution:

1) Each form (login,lost pass, etc.) is a separate .php file. I the file the form is wrapped by a get_header() and get_footer()

2) The action for each form is wp-login.php. So when my custom form is submitted wp-login.php does the form validation.

3) So that post valadation does not return the default response (form from wp-admin.php) I have added a wp_redirect() function that forwards my my custom forms.

Like I said this works but now I want to use the default error messages in my custom forms and can not figure out how to get the errors messages to show in my custom form pages.

Possible Solutions: 1) wo-login.php uses a switch to select which form to show based on the form validation. Is there a way I can hook into that and have my form called instead? The I can use wp-login.php to do everything.

2) Do I need to include a global variable for the error messages on my pages?

3) I kind of tried copying wp-login.php and stripped out the body, head and functions that I don't need. I kinda works but not really.

FYI....I do not want to use Theme My Login as a solution.

share|improve this question

1 Answer 1

Have you tried creating a error? Something like:

function wpse_23982_admin_notices() {
    if ( isset( $_GET['extendd-message'] ) && $_GET['extendd-message'] == 'response_error' ) {
        add_settings_error( 'extendd-notices', 'extendd-remote-api-fail', __( 'There was an error connecting to extendd.com/. Please try again at another time.', 'extendd' ), 'error' );
    }

}
add_filter( 'registration_errors', 'wpse_23982_admin_notices' );

Then on the error do something like wp_redirect with error.

wp_url.com/?extendd-message=response_error
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.