You can try to use this below code :
protected $wishlist;
protected $registry;
public function __construct(
...
\Magento\Wishlist\Model\Wishlist $wishlist,
\Magento\Framework\Registry $registry,
...
) {
...
$this->wishlist = $wishlist;
$this->registry = $registry;
...
}
public function yourFunction(){
$customer_id = 1;
$wishlist_collection = $this->wishlist->loadByCustomerId($customer_id, true)->getItemCollection();
$current_product = $this->_registry->registry('current_product');
foreach ($wishlist_collection as $item) {
if($current_product->getId() == $item->getProduct()->getId())
{
// current item added in wishlist
} else {
// current item not added in wishlist
}
}
}
UPDATE :
Object Manager Method :
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$session = $objectManager->get('Magento\Customer\Model\Session');
$customer_id = $session->getCustomer()->getId();
$wishlist_collection = $objectManager->get('Magento\Wishlist\Model\Wishlist')->loadByCustomerId($customer_id, true)->getItemCollection();
$current_product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');
foreach ($wishlist_collection as $item) {
if($current_product->getId() == $item->getProduct()->getId())
{
// current item added in wishlist
} else {
// current item not added in wishlist
}
}