Simple method to swap Favorite and Write a Review items?

I’m wondering if there is a simple method to swap the Favorite Link with the Write a Review link in the listing actions secondary section on listing pages?

Please try this code snippet:

add_filter(
	'hivepress/v1/templates/listing_view_page',
	function( $blocks ) {
		$favorite_link = hivepress()->template->fetch_block( $blocks, 'listing_favorite_toggle' );
		$review_link   = hivepress()->template->fetch_block( $blocks, 'review_submit_link' );

		return hivepress()->template->merge_blocks(
			$blocks,
			[
				'listing_actions_secondary' => [
					'blocks' => [
						'listing_favorite_toggle' => $review_link,
					],
				],

				'listing_actions_primary'   => [
					'blocks' => [
						'review_submit_link' => $favorite_link,
					],
				],
			]
		);
	},
	1000
);

Perfect. Thank you very much!

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