Skip to content

Commit

Permalink
AJAX listings pagination not working is email allowed to show on list…
Browse files Browse the repository at this point in the history
…ings - FIXED
  • Loading branch information
kprajapatii committed Jul 19, 2019
1 parent 44b92e5 commit 9be4957
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Expand Up @@ -7,6 +7,7 @@
* GD Single Tabs, widget now has option to output head and body separately - ADDED
* Category default image not working when category imported via csv - FIXED
* Jupiter theme GD page sidebars not working - FIXED
* AJAX listings pagination not working is email allowed to show on listings - FIXED

= 2.0.0.64 =
* Beaver Builder content does not work for archive item template - FIXED
Expand Down
17 changes: 13 additions & 4 deletions includes/custom-fields/output-functions.php
Expand Up @@ -1297,7 +1297,7 @@ function geodir_cf_email($html,$location,$cf,$p='',$output=''){
$is_elementor_preview = class_exists( 'GeoDir_Elementor' ) && GeoDir_Elementor::is_elementor_view() ? true : false; // Check if elementor preview
$email = $gd_post->{$cf['htmlvar_name']} ;
$value = '';
if ( ! empty( $email ) && ( $email != 'testing@example.com' ) && ( $e_split = explode( '@', $email ) ) && ! defined( 'REST_REQUEST' ) && ! $is_elementor_preview ){
if ( ! empty( $email ) && ( $email != 'testing@example.com' ) && ( $e_split = explode( '@', $email ) ) && ! defined( 'REST_REQUEST' ) && ! $is_elementor_preview && ! wp_doing_ajax() ) {
/**
* Filter email custom field name output.
*
Expand All @@ -1306,10 +1306,19 @@ function geodir_cf_email($html,$location,$cf,$p='',$output=''){
* @param string $email The email string being output.
* @param array $cf Custom field variables array.
*/
$email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
$email_name = apply_filters( 'geodir_email_field_name_output', $email, $cf );
$value .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
} elseif ( ! empty( $email ) && ( ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $is_elementor_preview ) ) {
$value .= "<a href='mailto:$email'>$email</a>";
} elseif ( ! empty( $email ) && ( ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $is_elementor_preview || wp_doing_ajax() ) ) {
/**
* Filter email custom field name output.
*
* @since 1.5.3
*
* @param string $email The email string being output.
* @param array $cf Custom field variables array.
*/
$email_name = apply_filters( 'geodir_email_field_name_output', $email, $cf );
$value .= "<a href='mailto:$email'>$email_name</a>";
} else {
$value .= $email;
}
Expand Down

0 comments on commit 9be4957

Please sign in to comment.