Hey there @agencia221b, Jorge here.
We got a reply from our colleagues with a small snippet to help you accomplish this.
Just create a mu-plugin with the following code:
<?php
add_filter(
'forminator_field_hidden_field_value',
function( $value, $saved_value, $field ) {
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
$replacements = array(
'USER_FIRST_NAME' => $current_user->user_firstname,
'USER_LAST_NAME' => $current_user->user_lastname,
'USER_NICKNAME' => get_user_meta( $current_user->ID, 'nickname', true ),
);
$value = str_replace( array_keys( $replacements ), array_values( $replacements ), $value );
}
return $value;
},
20,
3
);
You would need to add 3 hidden fields in form, edit them and set “Custom Value” as Default Value. For firstname insert USER_FIRST_NAME , for last name insert USER_LAST_NAME and or nickname add USER_NICKNAME. Those should be replaced with the according values.
You need to save this file on wp-content/mu-plugins
Hope this helps, and feel free to reach out if you have any further questions.
Regards,
Jorge