/**
* Set password by field value
*/
function set_password_from_field( $user_id, $feed, $entry, $user_pass ) {
$form_id = rgar( $entry, 'form_id' );
// set field id
if ( '4' === $form_id ) {
wp_set_password( $entry[11], $user_id );
}
}
add_action( 'gform_user_registered', 'set_password_from_field', 10, 4 );