Skip to content

Commit

Permalink
Merge pull request #2621 from kprajapatii/master
Browse files Browse the repository at this point in the history
2.3.59
  • Loading branch information
kprajapatii authored Jun 27, 2024
2 parents a60cf12 + d87a5da commit ca4f807
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 96 deletions.
4 changes: 2 additions & 2 deletions geodirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,7 +34,7 @@ final class GeoDirectory {
*
* @var string
*/
public $version = '2.3.58';
public $version = '2.3.59';

/**
* GeoDirectory instance.
Expand Down
47 changes: 37 additions & 10 deletions includes/class-geodir-elementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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' ) {
Expand All @@ -295,15 +312,14 @@ public static function maybe_add_image_caption( $html, $widget ) {
$html = str_replace( '></figcaption>', '>' . esc_attr( $match[1] ) . '</figcaption>', $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 ) {
preg_match( '~settings[ ]*=[ ]*["\'](.*?)["\']~is', $settings['__dynamic__']['wp_gallery'], $match );
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 );
Expand Down Expand Up @@ -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('/<li class="elementor-icon-list-item" >([\n\r\s]+)<a href="#hide">(.*?)<\/li>/ms', '', $html);
$html = preg_replace('/<li class="elementor-icon-list-item" >([\n\r\s]+)<span class="elementor-icon-list-icon">([\n\r\s]+)<i aria-hidden="true" class="[a-z0-9 .\-]+"><\/i>([\n\r\s]+)<\/span>([\n\r\s]+)<span class="elementor-icon-list-text">#hide<\/span>([\n\r\s]+)<\/li>/', '', $html); // < 3.0
$html = preg_replace('/<li class="elementor-icon-list-item">([\n\r\s]+)<span class="elementor-icon-list-icon">([\n\r\s]+)<i aria-hidden="true" class="[a-z0-9 .\-]+"><\/i>([\n\r\s]+)<\/span>([\n\r\s]+)<span class="elementor-icon-list-text">#hide<\/span>([\n\r\s]+)<\/li>/', '', $html); // > 3.0+
}
}

// Add widget-icon-list CSS.
if ( ! empty( $html ) && ! empty( $geodir_ele_icss ) && $geodir_ele_icss === 1 && in_array( $widget->get_name(), array( 'icon-list', 'wp-widget-gd_post_content', 'wp-widget-gd_post_meta' ) ) ) {
$geodir_ele_icss = 2;
$widget_config = $widget->get_name() == 'icon-list' ? $widget->get_css_config() : $widget->get_widget_css_config( 'icon-list' );

if ( ! empty( $widget_config ) && ! empty( $widget_config['data']['file_url'] ) ) {
$widget_css = '<link id="elementor-widget-icon-list" rel="stylesheet" href="' . esc_url( $widget_config['data']['file_url'] ) . '">';
$html = $widget_css . $html;
}
}

// Replaces some encodes entities back to normal to prevent JavaScript errors.
if ( ! empty( $html ) && $widget->get_name() == 'text-editor' && strpos( $html, 'geodir-' ) !== false && strpos( $html, '<script' ) !== false ) {
$html = geodir_untexturize( $html );
Expand Down
2 changes: 1 addition & 1 deletion includes/class-geodir-fast-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static function allowed_plugins( $plugins = array() ) {

// Page builder plugins
if ( in_array( $action, array( 'geodir_ajax_search' ) )
&& ( strpos( $plugin, 'elementor' ) !== false || strpos( $plugin, 'kadence' ) !== false || strpos( $plugin, 'bb-custom-attributes' ) !== false || strpos( $plugin, 'bb-plugin' ) !== false || strpos( $plugin, 'bb-theme-builder' ) !== false || strpos( $plugin, 'buddyboss-platform' ) !== false || strpos( $plugin, 'userswp' ) !== false || strpos( $plugin, 'fusion-builder' ) !== false )
&& ( strpos( $plugin, 'elementor' ) !== false || strpos( $plugin, 'kadence' ) !== false || strpos( $plugin, 'bb-custom-attributes' ) !== false || strpos( $plugin, 'bb-plugin' ) !== false || strpos( $plugin, 'bb-theme-builder' ) !== false || strpos( $plugin, 'buddyboss-platform' ) !== false || strpos( $plugin, 'userswp' ) !== false || strpos( $plugin, 'fusion-builder' ) !== false || strpos( $plugin, 'all-in-one-wp-security-and-firewall' ) !== false )
|| ( ! empty( $_REQUEST['gdbdate'] ) && ( strpos( $plugin, 'invoicing' ) !== false || strpos( $plugin, 'getpaid-wallet' ) !== false ) )
|| ( in_array( $action, array( 'geodir_cpt_search_field_form', 'geodir_cpt_search_save_field' ) ) && ! empty( $_REQUEST['htmlvar_name'] ) && $_REQUEST['htmlvar_name'] == 'gdbdate' && strpos( $plugin, 'invoicing' ) !== false )
) {
Expand Down
Binary file modified languages/geodirectory-en_US.mo
Binary file not shown.
Loading

0 comments on commit ca4f807

Please sign in to comment.