Code snippet no longer working

Hey there,

I have been using this code snippet for sometime to make it mandatory for users to upload an image to listings on the platform.

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if ( isset( $form['fields']['images'] ) ) {
			$form['fields']['images']['statuses'] = ['optional' => null];
		}

		return $form;
	},
	1000
);

But I have noticed today that users are no longer uploading images to there listings. When i tried to post a listing myself it didn’t require an image to post it. What could be causing this piece of code to stop working?

Cheers

1 Like

Please try this PHP snippet instead Require uploading at least one image for listings #hivepress #listings · GitHub