= $j || $rating == '5' ) { $starRating .= ''; }elseif( $rating < $j && $rating > $i ) { $starRating .= ''; } else { $starRating .= ''; } } // if( $echo == true ) { echo wp_kses( $starRating, [ 'i' => ['class' => [] ] ] ); } else { return $starRating; } } public static function includeCurrentPathFile( $path, $fileName ) { if( !is_array( $fileName ) ) { require_once( plugin_dir_path( $path ).$fileName ); } else { foreach( $fileName as $name ) { require_once( plugin_dir_path( $path ).$name ); } } } public static function getElementorIcon( $optionValue ) { if( empty( $optionValue ) ) { return; } // if( 'svg' != $optionValue['library'] ) { if( !empty( $optionValue['value'] ) ) { return ''; } } else { return ''; } } public static function getElementorLinkHandler( $url, $innerData, $class= 'anchor--link' ) { // if( !empty( $url['url'] ) ) { $target = '_self'; if( !empty( $url['is_external'] ) && $url['is_external'] == 'on' ) { $target = '_blank'; } // $addNofollow = ''; if( !empty( $url['nofollow'] ) ) { $addNofollow = 'rel="nofollow"'; } return ''.self::allowFormattingTagHtml( $innerData ).''; } } /** * allowFormattingTagHtml * * @param string $text * @return void */ public static function allowFormattingTagHtml( $text = '' ) { if( empty( $text ) ) { return; } $allowHtml = [ 'span' => ['class' => [],'style' => []], 'b' => [], 'strong' => [], 'br' => [], 'i' => ['class' => []], 'svg' => [], 'small' => [], 'img' => ['src'=>[],'class' => []] ]; return wp_kses( $text, $allowHtml ); } /** * currency list * @return array */ public static function getCurrencyList() { return [ '' => esc_html__( 'None', 'enteraddons' ), 'baht' => '฿ ' . esc_html__( 'Baht', 'enteraddons' ), 'bdt' => '৳ ' . esc_html__( 'BD Taka', 'enteraddons' ), 'dollar' => '$ ' . esc_html__( 'Dollar', 'enteraddons' ), 'euro' => '€ ' . esc_html__( 'Euro', 'enteraddons' ), 'franc' => '₣ ' . esc_html__( 'Franc', 'enteraddons' ), 'guilder' => 'ƒ ' . esc_html__( 'Guilder', 'enteraddons' ), 'indian_rupee' => '₹ ' . esc_html__( 'Rupee (Indian)', 'enteraddons' ), 'krona' => 'kr ' . esc_html__( 'Krona', 'enteraddons' ), 'lira' => '₤ ' . esc_html__( 'Lira', 'enteraddons' ), 'peseta' => '₧ ' . esc_html__( 'Peseta', 'enteraddons' ), 'peso' => '₱ ' . esc_html__( 'Peso', 'enteraddons' ), 'pound' => '£ ' . esc_html__( 'Pound Sterling', 'enteraddons' ), 'real' => 'R$ ' . esc_html__( 'Real', 'enteraddons' ), 'ruble' => '₽ ' . esc_html__( 'Ruble', 'enteraddons' ), 'rupee' => '₨ ' . esc_html__( 'Rupee', 'enteraddons' ), 'shekel' => '₪ ' . esc_html__( 'Shekel', 'enteraddons' ), 'yen' => '¥ ' . esc_html__( 'Yen/Yuan', 'enteraddons' ), 'won' => '₩ ' . esc_html__( 'Won', 'enteraddons' ), 'custom' => esc_html__( 'Custom', 'enteraddons' ), ]; } public static function getCurrencySymbol( $symbol_code ) { $symbolList = [ 'baht' => '฿', 'bdt' => '৳', 'dollar' => '$', 'euro' => '€', 'franc' => '₣', 'guilder' => 'ƒ', 'indian_rupee' => '₹', 'krona' => 'kr', 'lira' => '₤', 'peseta' => '₧', 'peso' => '₱', 'pound' => '£', 'real' => 'R$', 'ruble' => '₽', 'rupee' => '₨', 'shekel' => '₪', 'yen' => '¥', 'won' => '₩', ]; return !empty( $symbolList[$symbol_code] ) ? $symbolList[$symbol_code] : ''; } /** * enteraddons_elementor * @return void */ public static function enteraddons_elementor() { return \Elementor\Plugin::instance(); } /** * is_elementor_edit_mode * @return boolean */ public static function is_elementor_edit_mode() { $elementor = self::enteraddons_elementor(); return $elementor->editor->is_edit_mode() || $elementor->preview->is_preview_mode() || is_preview(); } /** * * Check WooCommerce plugin activities * * @return string * */ public static function is_woo_activated() { $isWoo = false; if( class_exists( 'woocommerce' ) ) { $isWoo = true; } return $isWoo; } /** * Change editor js folder permissions mode to work properly * @return void * */ public static function change_permissions_mode() { $dir = ENTERADDONS_DIR_CORE.'libs/editor/js'; if( !chmod($dir,0777) ) { chmod($dir,0777); } } /** * [elementor_content_display description] * @param [type] $contentId [description] * @return [type] [description] */ public static function elementor_content_display( $contentId = '' ) { if( !self::is_elementor_edit_mode() ) { global $ea_cache_dir_url, $ea_cache_file_prefix; // $handle = $ea_cache_file_prefix.$contentId; $url = $ea_cache_dir_url.$handle.'.css'; $version = ENTERADDONS_VERSION.'.'.get_post_modified_time( 'U', false, $contentId, false ); // Enqueue Header Widget Css for Front-End wp_enqueue_style( $handle, $url, array('elementor-frontend'), $version, false ); } //wp_enqueue_style( 'enteraddons-'.$contentId ); return \Elementor\Plugin::$instance->frontend->get_builder_content_for_display( $contentId ); } /** * [menu_list description] * @return [type] [description] */ public static function menu_list(){ $siteMenu = wp_get_nav_menus(); $getMenu = []; $getMenu[''] = esc_html__( 'Select A Menu','enteraddons' ); foreach( $siteMenu as $menu ) { $getMenu[ $menu->slug ] = $menu->name; } return $getMenu; } public static function is_pro_active() { return apply_filters( 'enteraddons_is_pro', false ); } public static function getPages() { return get_pages(); } public static function getPagesIdTitle() { $pages = self::getPages(); $getList = []; if( !empty( $pages ) ) { foreach( $pages as $page ) { $getList[$page->ID] = $page->post_title; } } return $getList; } public static function checkPhpV81() { $b = version_compare( ENTERADDONS_CURRENT_PHPVERSION, '8.0.99', '>' ); $l = version_compare( ENTERADDONS_CURRENT_PHPVERSION, '8.2', '<' ); if( $b && $l ) { return true; } else { return false; } } public static function getElementorTemplates() { $args = array( 'post_type' => 'elementor_library', 'numberposts' => '-1', 'post_status' => 'publish' ); $elementor_templates = get_posts($args); $templates = []; foreach ( $elementor_templates as $template ) { $templates[$template->ID] = $template->post_title; } return $templates; } public static function versionType() { return self::is_pro_active() ? 'PRO' : 'LITE'; } public static function ea_brand_icon_html() { return ''; } public static function ea_post_categoris() { $terms = get_terms( [ 'taxonomy' => 'category', 'hide_empty' => true ] ); $getTerms = []; if( !empty( $terms ) ) { foreach( $terms as $term ) { $getTerms[$term->term_id] = $term->name; } } return $getTerms; } public static function ea_ai_models_html() { $html = ''; return apply_filters( 'ea_ai_models_html', $html ); } } // Class End