How to use filter to disable adding a product to wishlist?

I am using a plugin on my website that made the following filter available:

Added filter ‘tinvwl_allow_addtowishlist_single_product’ that helps to
show/hide the “Add to Wishlist” button for specific products on a
single products page

The filter comes into place here:

if ( empty( $this->product ) || ! apply_filters( 'tinvwl_allow_addtowishlist_single_product', true, $this->product ) ) {
    return;
}

I would now like to add this filter to a single product page to disable the “add to wishlist” functionality in some cases, but

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s