The code snippet to add at least 1 image per listing is not working anymore

please i facing a challenge with this snippet code , the code was working perfectly and suddenly stop

add_filter(
	'hivepress/v1/forms/listing_update/errors',
	function( $errors, $form ) {
		$listing = $form->get_model();

		if ( $listing && ! $listing->get_image__id() ) {
			$errors[] = 'Please upload at least one image.';
		}

		return $errors;
	},
	100,
	2
);

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

		return $form;
	},
	1000
);

Hi!
Please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.

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