Hide attributes fields for a specific category

I have a category with id 320, I want to hide some attribute fields if a user selects that category. How do I go about it?

Another question is how do I rename the “Requests” menu on the left side bar to “Music Submissions” ?

Hi,

  1. Please try use this snippet like a sample (you will need to change the price to the name of the field of your attribute):
add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset($attributes['price']) ) {
			$attributes['price']['categories'] = [1,2,3];
		}

		return $attributes;
	},
	1000
);

Please note that it can require further customization.

  1. You can change this with the Loco Translate plugin How to translate an extension - HivePress Help Center, but note that the changes will be applied to all pages where the word appears.
    To change only one page, you will need a PHP snippet.

​I hope this is helpful to you.

2 Likes

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