Make some social links required

Bit of an odd request, but my clients wants it when potential customers fill out the Add Listing form ,that some of the social link options, like Website and Instagram, are required. Not all the social links. Like if they don’t have a LInkedIn profile, that’s OK, but they really want listings with actual websites so that they are clearly much more of a legitimate business.

Makes sense, but I don’t think it’s really possible with the Social Links extension. Is it?

Yes, it’s possible but requires a code snippet. Please try this sample snippet and add or change the field names to make other fields required:

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		
		$form['fields']['linkedin']['required'] = true;
		$form['fields']['twitter']['required'] = true;
		
		return $form;
	},
	1000
);
1 Like

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