Join our new community forum for support & discussion

Join Now

Home Support Extensions Bookings Hiding booking form for non-members

Hiding booking form for non-members

  • Author
    Posts
  • shadowsfall

    Hi, I would like to hide the booking form for non-members (Membership Extension). Could you please share the code snippet?

    ihor developer

    Please try this one:

    add_filter(
    	'hivepress/v1/templates/listing_view_page/blocks',
    	function( $blocks ) {
    		if ( ! hivepress()->request->get_context( 'membership' ) ) {
    			$blocks = hivepress()->helper->merge_trees(
    				[ 'blocks' => $blocks ],
    				[
    					'blocks' => [
    						'booking_make_form' => [
    							'type' => 'content',
    						],
    					],
    				]
    			)['blocks'];
    		}
    
    		return $blocks;
    	},
    	1000
    );

    You can add it via the Code Snippets plugin https://wordpress.org/plugins/code-snippets/

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.