Set a default time zone for the listing registration page

I’m trying to set the default location of new listings to America/Sao_Paulo, but is not working.

I’ve tried the following PHP snippet, without success:

add_action('hivepress/v1/models/listing/create', 
	function($listing_id) {
		if(get_option('hp_booking_enable_time') && get_option('hp_booking_enable_timezone')){
			update_post_meta($listing_id, 'hp_booking_timezone', 'America/Los_Angeles');	
		}
	},
	1000
);

Thanks in advance.

Please ensure you have correctly put this code snippet with the Code Snippets plugin or the similar one. Also, please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, please ensure that caching is disabled for logged-in users. It was tested locally, and it seems to be ok. Please try to add two listings because there also can be a problem with the auto-draft listing, which was created before you added the code snippet

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