Skip to content

Commit

Permalink
Merge pull request #2578 from kprajapatii/master
Browse files Browse the repository at this point in the history
2.3.51
  • Loading branch information
kprajapatii authored May 2, 2024
2 parents 5cfa606 + 1c0eb64 commit 354d73c
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 128 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.50
* Version: 2.3.51
* Author: AyeCode - WordPress 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.50';
public $version = '2.3.51';

/**
* GeoDirectory instance.
Expand Down
10 changes: 6 additions & 4 deletions includes/business-hours-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -902,16 +902,18 @@ function geodir_hhmm_to_bh_minutes( $hm, $day_no = 0 ) {
$hours = $hm;
$minutes = 0;

if ( strpos( $hm, ':' ) !== false ) {
list( $hours, $minutes ) = explode( ':', $hm );
}
if ( strpos( $hm, ':' ) !== false ) {
list( $hours, $minutes ) = explode( ':', $hm );
}

$hours = geodir_sanitize_float( $hours );

$diff = 0;
if ( $day_no > 0 ) {
$diff = ( $day_no - 1 ) * 60 * 24;
}

return ( ( $hours * 60 ) + $minutes ) + $diff;
return ( ( $hours * 60 ) + $minutes ) + $diff;
}

/**
Expand Down
28 changes: 24 additions & 4 deletions includes/class-geodir-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -1995,9 +1995,13 @@ public static function template_redirect() {
}

// Borlabs Cookie Integration
if ( defined( 'BORLABS_COOKIE_VERSION' ) && version_compare( BORLABS_COOKIE_VERSION, '3.0', '<' ) && ! is_admin() && geodir_get_option( 'borlabs_cookie' ) ) {
add_filter( 'geodir_lazy_load_map', array( __CLASS__, 'borlabs_cookie_setup' ), 999, 1 );
add_filter( 'wp_super_duper_widget_output', array( __CLASS__, 'borlabs_cookie_wrap' ), 999, 4 );
if ( defined( 'BORLABS_COOKIE_VERSION' ) ) {
if ( version_compare( BORLABS_COOKIE_VERSION, '3.0', '<' ) && ! is_admin() && geodir_get_option( 'borlabs_cookie' ) ) {
add_filter( 'geodir_lazy_load_map', array( __CLASS__, 'borlabs_cookie_setup' ), 999, 1 );
add_filter( 'wp_super_duper_widget_output', array( __CLASS__, 'borlabs_cookie_wrap' ), 999, 4 );
} else if ( version_compare( BORLABS_COOKIE_VERSION, '3.0', '>=' ) ) {
add_filter( 'geodir_lazy_load_map', array( __CLASS__, 'borlabs_cookie_lazy_load_map' ), 99, 1 );
}
}

// Kallyas theme Zion page builder
Expand Down Expand Up @@ -3953,7 +3957,7 @@ public static function borlabs_cookie_setting( $settings ) {
);

if ( defined( 'BORLABS_COOKIE_VERSION' ) && version_compare( BORLABS_COOKIE_VERSION, '3.0', '>=' ) ) {
$_setting['desc'] = __( 'NOTE: Go to Borlabs Cookie > Settings to enable Borlabs Cookie integration for GeoDirectory maps.', 'geodirectory' );
$_setting['desc'] = __( 'NOTE: Go to Borlabs Cookie > Library > Search "GeoDirectory" & install package.', 'geodirectory' );
$_setting['custom_attributes'] = array(
'disabled' => 'disabled'
);
Expand Down Expand Up @@ -4005,6 +4009,22 @@ public static function borlabs_cookie_setup( $lazy_load = '' ) {
return $lazy_load;
}

/**
* Borlabs Cookie filter lazy load map.
*
* @since 2.3.52
*
* @param string $lazy_load Lazy load type.
* @return string Filtered lazy load map.
*/
public static function borlabs_cookie_lazy_load_map( $lazy_load = '' ) {
if ( $lazy_load && is_admin() && ! wp_doing_ajax() ) {
$lazy_load = ''; // Disable lazy load map in backend.
}

return $lazy_load;
}

/**
* Wrap map content by Borlabs Cookie.
*
Expand Down
Binary file modified languages/geodirectory-en_US.mo
Binary file not shown.
Loading

0 comments on commit 354d73c

Please sign in to comment.