PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Framework
/
Helpers
<?php namespace WilokeListingTools\Framework\Helpers; class Submission { protected static $aSupportedPostTypes; protected static $aAddListingPostTypes; protected static $aPlanSettings; public static function detectPostStatus() { if (GetWilokeSubmission::getField('approved_method') == 'manual_review') { $newStatus = 'pending'; } else { $newStatus = 'publish'; } return $newStatus; } public static function convertGalleryToBackendFormat($aRawGallery) { if (empty($aRawGallery)) { return []; } $aGallery = []; foreach ($aRawGallery as $aImg) { $aGallery[$aImg['id']] = $aImg['src']; } return $aGallery; } public static function isPlanSupported($planID, $key) { if (!isset(self::$aPlanSettings[$planID])) { self::$aPlanSettings[$planID] = GetSettings::getPlanSettings($planID); } return !isset(self::$aPlanSettings[$planID][$key]) || self::$aPlanSettings[$planID][$key] !== 'disable'; } public static function listingStatusWillPublishImmediately($postStatus) { return !empty($postStatus) && in_array($postStatus, ['expired', 'publish']); } public static function getAddListingPostTypeKeys() { self::getSupportedPostTypes(); $aPlans = GetSettings::getFrontendPostTypes(true); foreach ($aPlans as $key => $postType) { if (!in_array($postType, self::$aSupportedPostTypes)) { unset($aPlans[$key]); } } return $aPlans; } public static function getSupportedPostTypes() { if (!empty(self::$aSupportedPostTypes)) { return self::$aSupportedPostTypes; } $aPostTypesInfo = GetSettings::getOptions(wilokeListingToolsRepository()->get('addlisting:customPostTypesKey')); if (empty($aPostTypesInfo)) { return false; } $aEventGeneralSetting = GetSettings::getOptions(wilokeListingToolsRepository()->get('event-settings:keys', true)->sub('general')); if (isset($aEventGeneralSetting['toggle_event']) && $aEventGeneralSetting['toggle_event'] == 'disable') { $aPostTypesInfo = array_filter($aPostTypesInfo, function ($aPostType) { if ($aPostType['key'] == 'event') { return false; } return true; }); } $aPostTypesInfo = array_filter($aPostTypesInfo, function ($aPostType) { if (isset($aPostType['isDisableOnFrontend']) && $aPostType['isDisableOnFrontend'] == 'yes') { return false; } return true; }); self::$aSupportedPostTypes = array_map(function ($aData) { return $aData['key']; }, $aPostTypesInfo); return self::$aSupportedPostTypes; } public static function getListingPostTypes() { if (!empty(self::$aAddListingPostTypes)) { return self::$aAddListingPostTypes; } $aPostTypesInfo = GetSettings::getOptions(wilokeListingToolsRepository()->get('addlisting:customPostTypesKey')); if (empty($aPostTypesInfo)) { return false; } $aEventGeneralSetting = GetSettings::getOptions(wilokeListingToolsRepository()->get('event-settings:keys', true)->sub('general')); if (isset($aEventGeneralSetting['toggle_event']) && $aEventGeneralSetting['toggle_event'] == 'disable') { $aPostTypesInfo = array_filter($aPostTypesInfo, function ($aPostType) { if ($aPostType['key'] == 'event') { return false; } return true; }); }; self::$aAddListingPostTypes = array_map(function ($aData) { return $aData['key']; }, $aPostTypesInfo); return self::$aAddListingPostTypes; } }
[+]
..
[-] SearchFieldSkeleton.php
[edit]
[-] FileSystem.php
[edit]
[-] Response.php
[edit]
[-] GetWilokeSubmission.php
[edit]
[-] AbstractSkeleton.php
[edit]
[-] InheritCMB2Styles.php
[edit]
[-] ReviewSkeleton.php
[edit]
[-] RestaurantMenu.php
[edit]
[-] WooCommerce.php
[edit]
[-] MapHelpers.php
[edit]
[-] .DS_Store
[edit]
[-] Message.php
[edit]
[-] GetSettings.php
[edit]
[-] QueryHelper.php
[edit]
[+]
Collection
[-] Inc.php
[edit]
[-] UserSkeleton.php
[edit]
[-] Firebase.php
[edit]
[-] Repository.php
[edit]
[-] DebugStatus.php
[edit]
[-] MapFactory.php
[edit]
[-] SetSettings.php
[edit]
[-] AddListingFieldSkeleton.php
[edit]
[-] VideoHelper.php
[edit]
[-] SearchFormSkeleton.php
[edit]
[-] PostSkeleton.php
[edit]
[-] KCHelpers.php
[edit]
[-] ProductSkeleton.php
[edit]
[-] QRCodeGenerator.php
[edit]
[-] HTML.php
[edit]
[-] Time.php
[edit]
[-] PlanHelper.php
[edit]
[-] SemanticUi.php
[edit]
[-] AjaxMsg.php
[edit]
[-] Logger.php
[edit]
[-] Cookie.php
[edit]
[-] Validation.php
[edit]
[-] GalleryHelper.php
[edit]
[-] AuthorSkeleton.php
[edit]
[-] General.php
[edit]
[-] Submission.php
[edit]
[-] TermSetting.php
[edit]