post_type; $aelms_allowed_post_type = [ acadlix()->cpt()->course()->get_post_type(), ]; if (acadlix()->helper()->is_course_bundle_addon_active()) { $aelms_allowed_post_type[] = acadlix()->cpt()->course_bundle()->get_post_type(); } $type = 'course'; if (in_array($post_type, $aelms_allowed_post_type)) { if ($post_type == acadlix()->cpt()->course()->get_post_type()) { $aelms_item = acadlix()->model()->course()->ofCourse()->find($post->ID); $type = 'course'; } else if ($post_type == acadlix()->cpt()->course_bundle()->get_post_type()) { $aelms_item = acadlix()->model()->courseBundle()->ofCourseBundle()->find($post->ID); $type = 'course-bundle'; } if ($aelms_item && is_user_logged_in()) { $aelms_item_wishlist_count = acadlix()->model()->userActivityMeta() ->ofWishlist() ->where("type_id", $aelms_item->ID) ->where("user_id", get_current_user_id()) ->count(); ?>