Support » Plugin: Frontend Reset Password » Great plugin…shame form templates can’t be overridden in theme

  • Brilliant plugin with well thought out code. Just a shame that form templates cannot be overridden in theme or filtered. I wanted my form to only accept email login so had to hard code changes into template and that and my template backup folder was overwritten on next update! Might be a good feature going forward….:-)

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Richard Webster

    (@rwebster85)

    Hi mate thanks for the review! You actually can make templates in your theme folder, it’s only documented in the changelog though 🙂

    Custom templates. You can now override the download templates in your theme. Create a new folder inside your theme directory called “somdn-templates”, and follow the same template folder/file structure as found in the plugin’s “Templates” folders.

    Thanks so much for that @rwebster85. Was just about to go live so that’ll be really handy to fix right now!

    Really good plugin though mate. Struggled to find anything that dealt with the Reset Password form so well. Keep up the good work and better update the docs. Pretty sure others would appreciate it 🙂

    @rwebster85

    Just put lost_password_form.php in somdn-templates folder in the root of my child theme and doesn’t seem to override? Any ideas?

    Cheers

    Plugin Author Richard Webster

    (@rwebster85)

    Woops sorry my mate, I thought this was a review for my other plugin…..

    I will add in custom templates for this plugin tomorrow for you 🙂

    @rwebster85 LOL! Not a problem and cheers for offering to add this feature in. That’ll be fantastic. Looking forward to the update 🙂

    slr1979

    (@slr1979)

    @rwebster85 Any update on the above? Just gone live would love to get this updated so future updates are no problem. Thanks

    Plugin Author Richard Webster

    (@rwebster85)

    This is now live in version 1.1.8 🙂

    Create a new folder inside your theme directory called somfrp-templates, and follow the same template folder/file structure as found in the plugin’s templates folder.

    slr1979

    (@slr1979)

    Hi @rwebster85

    Just loaded but wasn’t working with child theme. Checked out the template function and noticed a filter so I placed the following in my child theme functions.php and bingo works like a dream 🙂

    // filter frontend password reset template for child-theme
    function filter_somfrp_get_templates($templates) {
    	if (get_template_directory() === get_stylesheet_directory()) {
    		// parent theme;
    		$theme_path = get_template_directory();
    	} else { 
    		//child theme; 
    		$theme_path = get_stylesheet_directory();
    	}
    	$templates = array(
    		'lost-form' => array(
    			'path' => SOMFRP_PATH . 'templates/lost_password_form.php',
    			'custom_path' => $theme_path . '/somfrp-templates/lost_password_form.php'
    			),
    		'reset-form' => array(
    			'path' => SOMFRP_PATH . 'templates/lost_password_reset_form.php',
    			'custom_path' => $theme_path . '/somfrp-templates/lost_password_reset_form.php'
    			),
    		'form-complete' => array(
    			'path' => SOMFRP_PATH . 'templates/lost_password_reset_complete.php',
    			'custom_path' => $theme_path . '/somfrp-templates/lost_password_reset_complete.php'
    			)
    	);
    	return $templates;
    }
    add_filter( 'somfrp_get_templates', 'filter_somfrp_get_templates', 10, 1 );

    Maybe you could add the bit of code that I wrote to check if the theme is a parent or child to your next update, then no filtering would be needed? 😉

    Cheers for the update though, that’s great!

    Plugin Author Richard Webster

    (@rwebster85)

    Sure thing mate I’ll add that in 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this review.