if (is_singular()) { if (\Elementor\User::is_current_user_can_edit_post_type(get_post_type())) { return \true; } } else { return \Elementor\User::is_current_user_can_edit_post_type('elementor_library'); } } return \false; } public static function get_icon($icon, $attributes = [], $tag = 'i') { \ob_start(); \Elementor\Icons_Manager::render_icon($icon, $attributes, $tag); $icon_html = \ob_get_clean(); return $icon_html; } public static function get_elementor_elements($type = '') { global $wpdb; $sql_query = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}postmeta\n\t\t\tWHERE meta_key LIKE %s\n\t\t\tAND meta_value LIKE %s\n\t\t\tAND post_id IN (\n\t\t\t\tSELECT id FROM {$wpdb->prefix}posts\n\t\t\t\tWHERE post_status LIKE 'publish'\n\t\t\t)", '_elementor_data', '%"widgetType":"' . $wpdb->esc_like($type) . '"%'); $results = $wpdb->get_results($sql_query); if (!\count($results)) { return \false; } $elements = array(); foreach ($results as $result) { $post_id = $result->post_id; $elementor_data = $result->meta_value; $elements_tmp = self::get_elements_from_elementor_data($elementor_data, 'form'); if (!empty($elements_tmp)) { foreach ($elements_tmp as $key => $value) { $elements[$post_id][$key] = $value; } } } return $elements; } public static function get_elements_from_elementor_data($elementor_data, $type = '') { $elements = array(); if (\is_string($elementor_data)) { $elementor_data = \json_decode($elementor_data); } if (!empty($elementor_data)) { foreach ($elementor_data as $element) { if ($type && $element->widgetType == $type) { $elements[$element->id] = $element->settings; } if (!empty($element->elements)) { $elements_tmp = self::get_elements_from_elementor_data($element->elements, $type); if (!empty($elements_tmp)) { foreach ($elements_tmp as $key => $value) { $elements[$key] = $value; } } } } } return $elements; } // remove the elementor Template main wrappers (added by "print_elements_with_wrapper") public static function template_unwrap($html = '') { $pos = \strpos($html, 'elementor-section-wrap'); if ($pos !== \false) { list($tmp, $html) = \explode('elementor-section-wrap', $html, 2); $tmp = \explode('<', $tmp); \array_pop($tmp); \array_pop($tmp); \array_pop($tmp); $pre = \implode('<', $tmp); list($tmp, $html) = \explode('>', $html, 2); $html = $pre . $html; for ($i = 0; $i < 3; $i++) { $pos = \strrpos($html, ''); if ($pos !== \false) { $html = \substr_replace($html, '', $pos, \strlen('')); } } } return $html; } public static function validate_html_tag($tag) { $allowed_tags = self::ALLOWED_HTML_WRAPPER_TAGS; return \in_array(\strtolower($tag), $allowed_tags, \true) ? $tag : 'div'; } /** * Validate Post Types * * @param string|array|void $post_type * @return mixed */ public static function validate_post_type($post_type) { $allowed_post_types = \DynamicContentForElementor\Helper::get_public_post_types(); if (\is_string($post_type) && \array_key_exists($post_type, $allowed_post_types)) { return $post_type; } else { if (\is_array($post_type)) { $post_type = \array_filter($post_type, function ($type) use($allowed_post_types) { return \array_key_exists($type, $allowed_post_types); }); return $post_type; } } return ''; } public static function get_active_devices_list() { return \Elementor\Plugin::$instance->breakpoints->get_active_devices_list(['reverse' => \true]); } /** * DCE Logo * * @return string */ public static function dce_logo() { return ' '; } }
Fatal error: Trait 'DynamicContentForElementor\Elementor' not found in /home/sportuga/public_html/wp-content/plugins/dynamic-content-for-elementor/class/helper.php on line 15