Join our new community forum for support & discussion

Join Now

Home Support Extensions Opening Hours Display only selected categories (opening hours)

Display only selected categories (opening hours)

  • Author
    Posts
  • Bemay1

    How to display only on selected categories?

    ihor developer

    Please try this PHP snippet (replace 1,2,3 with category IDs):

    add_filter(
    	'hivepress/v1/models/listing/attributes',
    	function( $attributes ) {
    		$category_ids = [ 1, 2, 3 ];
    
    		if ( isset( $attributes['opening_hours'] ) ) {
    			$attributes['opening_hours']['categories'] = $category_ids;
    		}
    
    		return $attributes;
    	},
    	1000
    );
Viewing 2 posts - 1 through 2 (of 2 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.