• Resolved vickkmartinez

    (@vickkmartinez)


    Hello. There is a way to limit the image upload size in the profile picture? I want to avoid people uploading big images.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor genetech

    (@genetech)

    Hi,

    You can add custom validation for any PR field in registration form using PR action/hook “pieregister_registration_validation_after”. Add something like following in your theme’s functions.php file.

    function validate_profile_size($posts, $errors) {
    	// inspect element to check your correct profile_pic field name. 
    	if( $_FILES['profile_pic_8']['size'] > 1000 ) {
    		$errors->add( "custom_pic_size" , '<strong>'.ucwords('error').'</strong>: '.apply_filters("piereg_Invalid_Username","'File Size is not valid.'"));
    	}
    }
    add_action('pieregister_registration_validation_after','validate_profile_size', 10, 2);

    Hope it helps.

    Thanks

    Plugin Contributor genetech

    (@genetech)

    Hi,

    We haven’t heard back from you in a while, so we are going to mark this as resolved – if you have any further questions, you can submit a new ticket.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit imagen size’ is closed to new replies.