Uname: Linux premium264.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.3.22 [ PHP INFO ] PHP os: Linux
Server Ip: 69.57.162.13
Your Ip: 216.73.216.219
User: workvvfb (1129) | Group: workvvfb (1084)
Safe Mode: OFF
Disable Function:
NONE

name : support.php
<?php
defined('ABSPATH') OR exit;


function is_shop_wpda() {
	static  $is_shop = null;
	if (!is_null($is_shop)) return $is_shop;
	/*if (class_exists('Elementor\Plugin') && \Elementor\Plugin::instance()->preview->is_preview()) {
		$is_shop = true;
		return $is_shop;
	}*/

	if(!class_exists('WooCommerce')) {
		$is_shop = false;

		return $is_shop;
	}

	if (is_singular()) {
		global $post;
		$post_id = $post->ID;
		$whitelist = apply_filters('wpda-builder/filter/allow-elementor/is_shop', array());
		if (is_array($whitelist) && count($whitelist)) {
			$meta = get_post_meta($post->ID, '_elementor_controls_usage', true);
			if (!empty($meta)) {
				$meta = maybe_unserialize($meta);

				foreach($whitelist as $item) {
					if(is_array($meta) && key_exists($item, $meta)) {
						$is_shop = true;
						break;
					}
				}
			}
			if (empty($meta) || !is_array($meta)) {

				function wpda_find_elementor_widget(&$key) {
					if(key_exists('widgetType', $key) && in_array($key['widgetType'], apply_filters('wpda-builder/filter/allow-elementor/is_shop', array()))) {
						return true;
					}

					if(key_exists('elements', $key) && is_array($key['elements']) && count($key['elements'])) {
						foreach($key['elements'] as &$element) {
							if (wpda_find_elementor_widget($element)) return true;
						}
					}
					return false;
				}

				$elementor       = \Elementor\Plugin::instance();
				$elementor_post  = $elementor->documents->get($post_id);
				$is_meta_updated = null;
				if($elementor_post !== false) {
					$meta = $elementor_post->get_json_meta('_elementor_data');
					foreach($meta as &$level0) {
						$is_shop =	wpda_find_elementor_widget($level0);
						if ($is_shop) break;
					}
				}

			}
		}
	}
	if (!$is_shop && (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy() || is_product() || is_cart() || is_account_page() || is_checkout())) {
		$is_shop = true;
	}
	if (!$is_shop) $is_shop = false;

	return $is_shop;
}
© 2025 GrazzMean