Is there a snippet code to hide this WhatsApp button from the unregistered public?
I’ve found this:
But it doesn’t work
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['whatsapp'] ) && !is_user_logged_in() ) {
$attributes['whatsapp']['display_format'] = 'Login to view';
}
return $attributes;
},
1000
);
add_filter(
'hivepress/v1/fields/phone',
function( $attributes ) {
if ( isset( $attributes['phone'] ) && !is_user_logged_in() ) {
$attributes['phone']['###########'] = '#user_login_modal';
}
return $attributes;
},
1000
);