Thread Starter
danMWD
(@danmwd)
I have made some advances in my previous issue, by using a counter to allow the function to only run once but I’m afraid I am also having some issues with further issues with the edit.profile script.
Specifically when an email is set to be required and a user edits their profile. If they do not put in a proper email the system returns an error, which is as expected – however if they leave the email field blank – the system doesn’t return an error but a message saying the profile was updated (although it actually isn’t). I believe this is an issue with the if statement on line 332 (or there abouts) that checks to see if an email has been “posted”. I am not 100% sure but I don’t think this if statement is necessary as it is already inside the “if check” to see if the email is required.
Perhaps you could let me know if I am correct. I am reluctant to remove the code myself – because any updates would need similar treatment if they are not fixed.
The other issue seems to be when a user updates their password inside the edit profile page. It seems to work the first time round then if they want to update the password again using the form that is presented after the first update it doesn’t seem to work – no update message is produced. The 3rd time and every other time (5th, 7th etc) seems to be OK. Not sure what is causing this or if it is just me. Perhaps it is something to do with the nonce?
Also could you tell me the equivalent filter for password reset – so I can make sure the password is strong. The example below is for when a user registers – but I am not able to find the equivalent filter for resetting the password.
add_filter(‘wppb_register_posted_password’, ‘verify’);
function verify($password){
/* verify password */
if (strlen($password) < 20)
add_filter(‘wppb_register_extra_error’, ‘nMessage’);
}
function nMessage(){
return ‘NEW ERROR MESSAGE HERE’;
}
Thanks in advance for any tips.
Hi,
Sorry about the delay. Regarding the first part, if you want to do stuff on profile update you’ll need to use these filters:
// Redirect after edit profile update
//add_filter('wppb_edit_profile_all_changes_saved', 'wppb_edit_profile_redirect');
//add_filter('wppb_edit_profile_all_changes_saved_except_existing_email', 'wppb_edit_profile_redirect');
//add_filter('wppb_edit_profile_all_changes_saved_except_invalid_email', 'wppb_edit_profile_redirect');
//add_filter('wppb_edit_profile_all_changes_saved_except_mismatch_password', 'wppb_edit_profile_redirect');
//add_filter('wppb_edit_profile_all_changes_saved_except_uncompleted_password', 'wppb_edit_profile_redirect');
function wppb_edit_profile_redirect( $content ){
return $content . '<meta http-equiv="Refresh" content="0;url='. trailingslashit( home_url( '/login-page/' ) ) .'" />';
}
Also, we’ll launch a update in the following weeks and these hooks will be removed from the plugin. So you might want to have a look at that when it’s available or don’t update the plugin.
> Also could you tell me the equivalent filter for password reset – so I can make sure the password is strong. The example below is for when a user registers – but I am not able to find the equivalent filter for resetting the password.
There will be native support for password strength in the future version of PB. So if you can wait for a week or so, that would solve this issue for you.
Thread Starter
danMWD
(@danmwd)
Thanks for your response.
Could you confirm too that the “errors” I mention above to do with the email being left blank and the password reset in the edit profile area are also going to be resolved in the new version or perhaps if I am misunderstand something and the errors I mentioned are just happening to me. Either way if you could confirm that would be great.
Looking forward to seeing the new version.
Thank you again for your time on this matter.
Those should not happen in the first place. The email should not be possible to be left blank.
But that being said, the new version has a completely different way of creating a submitting forms. So it will work as expected.
Thread Starter
danMWD
(@danmwd)
Could you confirm that there will be documentation for the new version of PB and that the documentation will include information on the functions and hooks such as wppb_register_userdata or profile_update OR their new equivalents?
Thanks again for your support.
Those things are not in the docs (better to just look into the code or ask me).
However, there will be the equivalent available. (Just looked in the Pro version that we launched yesterday http://www.cozmoslabs.com/wordpress-profile-builder/ and we don’t have theme there, but we’ll add them before launching the new version on the ww.wp.xz.cn repository )