Profile picture upload in registration form

Hi is there a snippet for adding the profile picture into the registration form, as I need people to have a profile picture before they post an advertisement.

Hi,

Unfortunately, there’s no such feature, it would require a custom implementation.

Hi,

I tried that but I ran into some problems, I managed to get the biography into the registration form, but the profile picture just didn’t work.

add_filter(
	'hivepress/v1/forms/user_register',
	function ( $form ) {
		$form['fields'] = array_merge(
			$form['fields'],
			[
				'first_name' => [
					'required' => true,
					'_order'   => 1,
				],

				'last_name'  => [
					'required' => true,
					'_order'   => 2,
				],
				'description' => [
					'required'	=> true,
					'_order'	=> 3,
				]
			
			]
		);

		return $form;
	},
	100
);

add_action(
	'hivepress/v1/models/user/register',
	function( $user_id, $values ) {
		if ( isset( $values['first_name'] ) ) {
			update_user_meta( $user_id, 'first_name', $values['first_name'] );
		}

		if ( isset( $values['last_name'] ) ) {
			update_user_meta( $user_id, 'last_name', $values['last_name'] );
		}
		if ( isset( $values['description'] ) ) {
			update_user_meta( $user_id, 'description', $values['description'] );
		}

	},
	10,
	2
);

this is the code that I used for the biography, do you know if there is a way that I can change this so that the profile picture also works?

Kind regards,

Nicky Jowenko

Sorry, there’s no easy way to move the profile image option to the registration form since uploading an attachment requires a user account (each attachment is linked to a user ID when uploaded). This would require a custom implementation.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.