Add Password Reset Link To Password Fields

Caldera Forms Banner

The Caldera Forms Users add-on provides a password field. If You want to add a password reset link, you can use the caldera_forms_render_field_structure_type-password filter, like so:


add_filter( 'caldera_forms_render_field_structure_type-password', 
'my_custom_reset_password_link');

function my_custom_reset_password_link( $structure ) {
   $link = sprintf(
        '<a href="%1$s" title="%2$s">%3$s</a>',
         site_url('/wp-login.php?action=lostpassword'),
         __('Reset password', 'theme_text_domain'),
         __('Lost Your Password?', 'theme_text_domain')
   );

   $structure[ 'field_caption' ] = $link;   

   return $structure;
}

Edit ‘theme_text_domain’ with the theme text domain of the active theme to allow text translation.