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 trying to create a shortcode for the login form to use on a page.

I have manage to get a simple form, but am looking to add the "forgot password link"

Here is what I have so far ... any way to add to this to have the form with the forgot link?

add_action( 'init', 'onco_add_shortcodes' );

function onco_add_shortcodes() {

    add_shortcode( 'onco-login-form', 'onco_login_form_shortcode' );
}

function onco_login_form_shortcode() {

    if ( is_user_logged_in() )
        return '<p>You are already logged in!</p>';

    return wp_login_form( array( 'echo' => false ) );
}
share|improve this question

1 Answer 1

To get the URL for lost password use wp_lostpassword_url()

Reference:

share|improve this answer
    
I saw that reference, but the problem is that it takes the user away from my page with the form on it ... which defeats having the custom page. –  Matthew Woodard Jan 20 at 6:49
    
Well you said you want the, and I quote you: "form with the forgot link". You have the form and you want to add a link. The link goes somewhere - which is obvious. So please clarify you needs. –  Borek Jan 20 at 7:02
    
@MatthewWoodard Any progress on clarifying your needs? –  kaiser May 1 at 22:40

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.