diff --git a/geodirectory.php b/geodirectory.php index 28ff544b..23c12bfb 100644 --- a/geodirectory.php +++ b/geodirectory.php @@ -11,7 +11,7 @@ * Plugin Name: GeoDirectory * Plugin URI: https://wpgeodirectory.com/ * Description: GeoDirectory - Business Directory Plugin for WordPress. - * Version: 2.3.58 + * Version: 2.3.59 * Author: AyeCode - WP Business Directory Plugins * Author URI: https://wpgeodirectory.com * Text Domain: geodirectory @@ -34,7 +34,7 @@ final class GeoDirectory { * * @var string */ - public $version = '2.3.58'; + public $version = '2.3.59'; /** * GeoDirectory instance. diff --git a/includes/class-geodir-elementor.php b/includes/class-geodir-elementor.php index b6ab088f..d6fce2d0 100644 --- a/includes/class-geodir-elementor.php +++ b/includes/class-geodir-elementor.php @@ -175,22 +175,36 @@ public static function clear_cache(){ * * @return bool */ - public static function maybe_hide_elements($should_render, $section){ + public static function maybe_hide_elements( $should_render, $section ) { + global $geodir_ele_iset, $geodir_ele_icss; + + if ( empty( $geodir_ele_render ) ) { + $geodir_ele_render = array(); + } $dynamic_settings = $section->get_parsed_dynamic_settings(); $class = ''; - if(isset($dynamic_settings['_css_classes'])){ + if ( isset( $dynamic_settings['_css_classes'] ) ) { $class = $dynamic_settings['_css_classes']; - }elseif(isset($dynamic_settings['css_classes'])){ + } else if ( isset( $dynamic_settings['css_classes'] ) ) { $class = $dynamic_settings['css_classes']; } - // remove if set to do so via class - if( $class == 'elementor-hidden gd-dont-render' ){ + // Remove if set to do so via class + if ( $class == 'elementor-hidden gd-dont-render' ) { $should_render = false; } + if ( $section->get_name() == 'icon-list' ) { + if ( $geodir_ele_iset && $geodir_ele_iset === 2 && $should_render && empty( $geodir_ele_icss ) ) { + $geodir_ele_icss = 1; + } + + if ( empty ( $geodir_ele_iset ) ) { + $geodir_ele_iset = $should_render ? 1 : 2; + } + } return $should_render; } @@ -284,9 +298,12 @@ public static function register_template_types($documents_manager){ * @return mixed Filters the html content. */ public static function maybe_add_image_caption( $html, $widget ) { + global $gd_post, $geodir_ele_iset, $geodir_ele_icss; + if ( geodir_is_page( 'single' ) || geodir_is_page( 'archive' ) ) { $type = $widget->get_name(); - if ($type === 'image' ) { + + if ( $type === 'image' ) { $settings = $widget->get_settings(); if ( ! empty( $settings['__dynamic__']['image'] ) && strpos( $settings['__dynamic__']['image'], 'name="gd-image"' ) !== false && ! empty( $settings['caption_source'] ) && $settings['caption_source'] == 'attachment' ) { @@ -295,7 +312,7 @@ public static function maybe_add_image_caption( $html, $widget ) { $html = str_replace( '>', '>' . esc_attr( $match[1] ) . '', $html ); } } - } elseif ( 'image-gallery' === $type ) { + } else if ( 'image-gallery' === $type ) { $settings = $widget->get_settings(); if ( ! empty( $settings['__dynamic__']['wp_gallery'] ) && strpos( $settings['__dynamic__']['wp_gallery'], 'name="gd-gallery"' ) !== false ) { @@ -303,7 +320,6 @@ public static function maybe_add_image_caption( $html, $widget ) { if ( ! empty( $match[1] ) ) { $gallery_settings = json_decode( urldecode( $match[1] ) ); if ( ! empty( $gallery_settings->key ) ) { - global $gd_post; $key = esc_attr( $gallery_settings->key ); $post_images = GeoDir_Media::get_attachments_by_type( $gd_post->ID, $key ); @@ -363,14 +379,25 @@ public static function maybe_add_image_caption( $html, $widget ) { $html = self::render_pro_carousel( $widget,$settings ); } - }elseif($type === 'icon-list'){ - // remove icon list items that have fallback link of #hide + } else if ( $type === 'icon-list' ) { + // Remove icon list items that have fallback link of #hide $html = preg_replace('/
  • ([\n\r\s]+)(.*?)<\/li>/ms', '', $html); $html = preg_replace('/
  • ([\n\r\s]+)([\n\r\s]+)