Please try using this code snippet to hide the Send Message button from listing pages of some specific categories:
add_filter(
'hivepress/v1/templates/listing_view_page/blocks',
function( $blocks, $template ) {
$listing = $template->get_context( 'listing' );
if ( $listing && array_intersect([1,2,3], (array)$listing->get_categories__id() ) {
$blocks = hivepress()->helper->merge_trees(
[ 'blocks' => $blocks ],
[
'blocks' => [
'message_send_link' => [
'type' => 'content',
],
],
]
)['blocks'];
}
return $blocks;
},
1000,
2
);
You just need to change this part: array_intersect([*categories id which you need to hide button, separate them with comma*], (array)$listing->get_categories__id()