Make tags required & limit quantity

Can we make TAGS mandatory instead of optional? How can I do this?

I would like to be able to set a maximum of 1 to 5 TAGS myself.

Please try this PHP snippet

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset( $attributes['tags'] ) ) {
			$attributes['tags']['edit_field'] = array_merge(
			$attributes['tags']['edit_field'],
			[
				'required' => true,
				'max_values' => 5,
			]
			);
		}
 
		return $attributes;
	},
	1000
);

I would like to set tags as optional, and if tags are used, I would like to set a limit of 10 tags.
Is this possible?

Please try to remove 'required' => true and change number 5 to number 10 in the code snippet above

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