PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wilcity-shortcodes
/
default-sc
<?php use WilokeListingTools\Framework\Helpers\GetWilokeSubmission; use WilokeListingTools\Frontend\PriceRange; use WilokeListingTools\Framework\Helpers\GetSettings; use \WilokeListingTools\Controllers\SearchFormController; use \WILCITY_SC\SCHelpers; add_shortcode('wilcity_sidebar_related_listings', 'wilcitySidebarRelatedListings'); function wilcitySidebarRelatedListings($aArgs) { global $post; $aAtts = is_array($aArgs['atts']) ? $aArgs['atts'] : SCHelpers::decodeAtts($aArgs['atts']); $aAtts = wp_parse_args( $aAtts, [ 'name' => 'Related Listings', 'icon' => 'la la-qq', 'style' => 'slider', 'conditional' => '' ] ); if (isset($aAtts['isMobile'])) { return apply_filters('wilcity/mobile/sidebar/related_listings', '', $post, $aAtts); } $aAdditionalArgs = []; switch ($aAtts['conditional']) { case 'listing_location': case 'listing_category': case 'listing_tag': $taxonomy = $aAtts['conditional']; if ($taxonomy == 'listing_category') { $taxonomy = 'listing_cat'; } $aTerms = GetSettings::getPostTerms($post->ID, $taxonomy); if (empty($aTerms)) { return ''; } $aLocations = []; foreach ($aTerms as $oRawLocation) { $aLocations[] = $oRawLocation->term_id; } $aAdditionalArgs['tax_query'] = [ 'relation' => 'OR', [ 'taxonomy' => $taxonomy, 'field' => 'term_id', 'terms' => $aLocations ], ]; break; case 'google_address': $aLatLng = GetSettings::getLatLng($post->ID); if (empty($aLatLng)) { return false; } $aAtts['oAddress'] = []; $aAtts['oAddress'] = $aLatLng; $aAtts['oAddress']['unit'] = 'KM'; $aAtts['oAddress']['radius'] = !empty($aAtts['radius']) ? abs($aAtts['radius']) : 10; break; case 'everywhere': $aAtts['aArgs']['post_type'] = GetSettings::getAllDirectoryTypes(true); break; default: break; } if (isset($aAtts['key']) && $aAtts['key'] == 'relatedListings') { $aAdditionalArgs['post_type'] = $post->post_type; } $postsPerPage = isset($aAtts['postsPerPage']) ? $aAtts['postsPerPage'] : 30; $aAtts['aAdditionalArgs'] = !isset($aAtts['aAdditionalArgs']) || empty($aAtts['aAdditionalArgs']) ? $aAdditionalArgs : array_merge($aAtts['aAdditionalArgs'], $aAdditionalArgs); $aAtts['postsPerPage'] = $postsPerPage; if (isset($aAtts['orderby']) && !empty($aAtts['orderby'])) { if (in_array($aAtts['orderby'], ['best_rated', 'best_viewed', 'recommended'])) { $aAtts[$aAtts['orderby']] = 'yes'; } } $aArgs = SearchFormController::buildQueryArgs($aAtts); if (!empty($aAtts['aAdditionalArgs'])) { $aArgs = array_merge((array)$aArgs, $aAtts['aAdditionalArgs']); unset($aAtts['aAdditionalArgs']); } if (isset($aArgs['isIgnorePostNotIn']) && $aArgs['isIgnorePostNotIn'] == 'yes') { unset($aArgs['postNotIn']); } $aArgs['post__not_in'] = isset($aArgs['postNotIn']) && is_array($aArgs['postNotIn']) ? array_merge($aArgs['postNotIn'], [$post->ID]) : [$post->ID]; $aAtts['aArgs'] = $aArgs; ob_start(); switch ($aAtts['style']) { case 'list': echo wilcityRenderSidebarList([ 'atts' => $aAtts ]); break; case 'grid': echo wilcityRenderSidebarGrid([ 'atts' => $aAtts ]); break; case 'slider': echo wilcityRenderSidebarSlider([ 'atts' => $aAtts ]); break; } $content = ob_get_contents(); ob_end_clean(); return $content; }
[+]
..
[-] wilcity-sidebar-single-price.php
[edit]
[-] wilcity-sidebar-list.php
[edit]
[-] wilcity-sidebar-business-hours.php
[edit]
[-] wilcity-header-slider.php
[edit]
[-] wilcity-author-profile.php
[edit]
[-] wilcity-sidebar-bookingcombannercreator.php
[edit]
[-] wilcity-sidebar-grid.php
[edit]
[-] wilcity-sidebar-categories.php
[edit]
[-] wilcity-sidebar-woocommerce-booking.php
[edit]
[-] wilcity-sidebar-slider.php
[edit]
[-] wilcity-thankyou-addlisting-pending.php
[edit]
[-] wilcity-gallery.php
[edit]
[-] wilcity-list-features.php
[edit]
[-] wilcity-group-properties.php
[edit]
[-] wilcity-sidebar-coupon.php
[edit]
[-] wilcity-listing-social-networks.php
[edit]
[-] wilcity-sidebar-header.php
[edit]
[-] wilcity-sidebar-taxonomy.php
[edit]
[-] wilcity-sidebar-statistics.php
[edit]
[-] wilcity-thankyou-promotion.php
[edit]
[-] wilcity-googlemap.php
[edit]
[-] wilcity-sidebar-terms-box.php
[edit]
[-] wilcity-sidebar-custom.php
[edit]
[-] wilcity-sharing-posts.php
[edit]
[-] wilcity-get-coupon.php
[edit]
[-] wilcity-google-adsense-in-article.php
[edit]
[-] wilcity-google-adsense.php
[edit]
[-] wilcity-sidebar-business-info.php
[edit]
[-] wilcity-pricing.php
[edit]
[-] wilcity-sidebar-price-range.php
[edit]
[-] wilcity-sidebar-related-listings.php
[edit]
[-] wilcity-sidebar-claim.php
[edit]
[-] wilcity-sidebar-my-products.php
[edit]
[-] wilcity-custom-login.php
[edit]
[-] wilcity-my-bank-account.php
[edit]
[-] wilcity-render-box-icon1.php
[edit]
[-] wilcity-sidebar-tags.php
[edit]
[-] wilcity-sidebar-google-adsense.php
[edit]
[-] wilcity-thankyou-addlisting-approved.php
[edit]