Make location required in only one attribute

with this snippet code below is possible to make location required only in categories 1 ,2 and 3.

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset( $attributes['location'] ) ) {
			$categories = [ 1, 2, 3 ];

			$attributes['location']['categories']  = $categories;
			$attributes['latitude']['categories']  = $categories;
			$attributes['longitude']['categories'] = $categories;
		}

		return $attributes;
	},
	1000
);

There is some way to select one category and attribute, I mean category 1 only on attribute 1510 for example?

If you mean assign location attribute to only one category, then please change 1,2,3 on 1, for example. So just put one category id instead of the 1,2,3

I mean inside one category exists two attributes, I want to display location only in one of those two attributes, is it possible?

Sorry, I can not understand what you want to get as a result. If it is possible, please provide screenshots with a description of what you want to get as a result or steps to reproduce this issue

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