Hi @nchaccal
You can use the following action hooks to modify the user details on User Registration and Profile Update:
um_after_user_updated
$user_id,
$args,
$to_update’
um_registration_set_extra_data
$user_id,
$args
Regards,
Hey there!
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂
Regards,
Hi!! Sorry for re-open again this thread.
I already did the function with your advice, but does not work with that hook. Maybe im doing something wrong?
My code works if i use the hook um_profile_content_main, but this clear the fields when user try to edit his profile.
I wanted to clear these fields after user edit his profile, but before send to DB.
I tried with um_user_before_updating_profile too. But nothing happen.
Any idea? BTW: I use the hook um_after_user_updated with another function already.
function remove_before_send ($args) {
?>
<script>
var elements = document.querySelectorAll('.um-is-conditional');
for (var i = 0; i < elements.length; i++) {
elements[i].childNodes[1].childNodes[0].value = "PROBANDO";
}
</script>
<?php
}
add_action('um_profile_content_main', 'remove_before_send');
By the way. I’m still looking for a solution and found this thread which is exactly my problem:
https://github.com/ultimatemember/ultimatemember/issues/381
Let me know if you could figure it out
Thanks!
Hi again!
I finally did it!
Im not proud, because i wanted to use php, but this is the best i could do:
function remove_before_send () {
?>
<script>
var boton = document.querySelector("#input");
boton.addEventListener("click", function(){
var elements = document.querySelectorAll('.um-is-conditional');
for (var i = 0; i < elements.length; i++) {
if (elements[i].style.display == "none") {
elements[i].childNodes[1].childNodes[0].value = "";
}
}
});
</script>
<?php
}
add_filter( 'um_profile_content_main', 'remove_before_send');
-
This reply was modified 3 years, 9 months ago by Nicolas.
Hi, sorry for re-open this thread.
I want to know if the last update of the plugin which fixed conditional logic for the form fields without metakeys, solve this situation.
I would like to delete my custom code if the plugin do it by itself.
Thanks anyway and happy new year!!