Sindbad~EG File Manager

Current Path : /home/xiedrke/entrepot/wp-content/plugins/realpress/app/Helpers/
Upload File :
Current File : /home/xiedrke/entrepot/wp-content/plugins/realpress/app/Helpers/WishList.php

<?php

namespace RealPress\Helpers;

class WishList {
	/**
	 * @param $property_id
	 * @param string $user_id
	 *
	 * @return bool
	 */
	public static function is_my_wishlist( $property_id, string $user_id = '' ) {
		if ( empty( $user_id ) && is_user_logged_in() ) {
			$user_id = get_current_user_id();
		}

		if ( empty( $user_id ) ) {
			$favorites = Cookie::get_cookie( 'realpress_wishlist_property' );
		} else {
			$favorites = get_user_meta( $user_id, REALPRESS_PREFIX . '_my_wishlist', true );
		}

		if ( empty( $favorites ) ) {
			return false;
		}

		if ( is_string( $favorites ) ) {
			$favorites = explode( ',', $favorites );
		}

		return in_array( $property_id, $favorites );
	}
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists