diff --git a/assets/js/opalestate.js b/assets/js/opalestate.js
index 2b0a7761..7ed5b370 100755
--- a/assets/js/opalestate.js
+++ b/assets/js/opalestate.js
@@ -1,8 +1,4 @@
jQuery( document ).ready( function ( $ ) {
-
- /**
- *
- */
$( '#show-user-sidebar-btn' ).click( function () {
$( 'body' ).toggleClass( 'active' );
} );
@@ -313,8 +309,7 @@ jQuery( document ).ready( function ( $ ) {
/**
* Login form
**/
- $( 'body' ).delegate( '.opalestate-mfp-popup form.opalestate-login-form', 'submit', function () {
-
+ $( 'form.opalestate-login-form' ).on( 'submit', function () {
var $form = $( this );
$.ajax( {
type: 'POST',
@@ -331,17 +326,15 @@ jQuery( document ).ready( function ( $ ) {
$form.find( '.opalestate-notice' ).remove();
$form.prepend( data.message );
}
-
}
} );
return false;
} );
/**
- * Login form
+ * Register form
**/
- $( 'body' ).delegate( '.opalestate-mfp-popup form.opalestate-register-form', 'submit', function () {
-
+ $( 'form.opalestate-register-form' ).on( 'submit', function () {
var $form = $( this );
$.ajax( {
type: 'POST',
@@ -358,11 +351,11 @@ jQuery( document ).ready( function ( $ ) {
$form.find( '.opalestate-notice' ).remove();
$form.prepend( data.message );
}
-
}
} );
return false;
} );
+
/**
* AJAX ACTION
*/
diff --git a/assets/opalestate.css b/assets/opalestate.css
index 2e837ee8..73b7aaad 100755
--- a/assets/opalestate.css
+++ b/assets/opalestate.css
@@ -3997,3 +3997,7 @@ header#masthead {
background: #2f73e9;
position: absolute;
top: 0; }
+
+ .opalestate-notice {
+ padding: 10px;
+ }
diff --git a/inc/class-opalestate-email.php b/inc/class-opalestate-email.php
index 348b94bc..e35259bb 100755
--- a/inc/class-opalestate-email.php
+++ b/inc/class-opalestate-email.php
@@ -29,17 +29,20 @@ class Opalestate_Emails {
public static function init() {
self::load();
- add_action( 'opalestate_processed_new_submission', [ __CLASS__, 'new_submission_email' ], 10, 2 );
- add_action( 'opalestate_processed_new_submission', [ __CLASS__, 'admin_new_submission_email' ], 15, 2 );
- //add_action( 'opalestate_processed_edit_submission' , array( __CLASS__ , 'new_submission_email'), 10, 2 );
if ( is_admin() ) {
add_filter( 'opalestate_settings_tabs', [ __CLASS__, 'setting_email_tab' ], 1 );
add_filter( 'opalestate_registered_emails_settings', [ __CLASS__, 'setting_email_fields' ], 10, 1 );
}
- $enable_approve_property_email = opalestate_get_option( 'enable_approve_property_email' );
+ if ( 'on' === opalestate_get_option( 'enable_customer_new_submission', 'on' ) ) {
+ add_action( 'opalestate_processed_new_submission', [ __CLASS__, 'new_submission_email' ], 10, 2 );
+ }
- if ( $enable_approve_property_email == 'on' ) {
+ if ( 'on' === opalestate_get_option( 'enable_admin_new_submission', 'on' ) ) {
+ add_action( 'opalestate_processed_new_submission', [ __CLASS__, 'admin_new_submission_email' ], 15, 2 );
+ }
+
+ if ( 'on' === opalestate_get_option( 'enable_approve_property_email', 'on' ) ) {
add_action( 'transition_post_status', [ __CLASS__, 'send_email_when_publish_property' ], 10, 3 );
add_action( 'opalestate_processed_approve_publish_property', [ __CLASS__, 'approve_publish_property_email' ], 10, 1 );
}
@@ -342,11 +345,22 @@ class Opalestate_Emails {
//------------------------------------------
[
- 'name' => esc_html__( 'Notification For New Property Submission (Customer)', 'opalestate-pro' ),
+ 'name' => esc_html__( 'New Property Submission (Customer)', 'opalestate-pro' ),
'desc' => '
',
'id' => 'opalestate_title_email_settings_3',
'type' => 'title',
],
+ [
+ 'name' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Enable email for customers when they have a submission.', 'opalestate-pro' ),
+ 'id' => 'enable_customer_new_submission',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
+ ],
[
'id' => 'newproperty_email_subject',
'name' => esc_html__( 'Email Subject', 'opalestate-pro' ),
@@ -368,10 +382,22 @@ class Opalestate_Emails {
//------------------------------------------
[
- 'name' => esc_html__( 'Notification For New Property Submission (Admin)', 'opalestate-pro' ),
- 'desc' => '
',
- 'id' => 'opalestate_title_email_settings_admin',
- 'type' => 'title',
+ 'name' => esc_html__( 'New Property Submission (Admin)', 'opalestate-pro' ),
+ 'desc' => '
',
+ 'id' => 'opalestate_title_email_settings_admin',
+ 'type' => 'title',
+ 'before_row' => '
',
+ ],
+ [
+ 'name' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Enable email for admin when a property is submitted.', 'opalestate-pro' ),
+ 'id' => 'enable_admin_new_submission',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
],
[
'id' => 'admin_newproperty_email_subject',
@@ -394,12 +420,12 @@ class Opalestate_Emails {
//------------------------------------------
[
- 'name' => esc_html__( 'Approve property for publish', 'opalestate-pro' ),
- 'desc' => '
',
- 'id' => 'opalestate_title_email_settings_4',
- 'type' => 'title',
+ 'name' => esc_html__( 'Approved property for publish (Customer)', 'opalestate-pro' ),
+ 'desc' => '
',
+ 'id' => 'opalestate_title_email_settings_4',
+ 'type' => 'title',
+ 'before_row' => '
',
],
-
[
'name' => esc_html__( 'Enable approve property email', 'opalestate-pro' ),
'desc' => esc_html__( 'Enable approve property email.', 'opalestate-pro' ),
@@ -409,9 +435,8 @@ class Opalestate_Emails {
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
- 'default' => 'off',
+ 'default' => 'on',
],
-
[
'id' => 'approve_email_subject',
'name' => esc_html__( 'Email Subject', 'opalestate-pro' ),
@@ -434,10 +459,11 @@ class Opalestate_Emails {
],
/// enquire contact template ////
[
- 'name' => esc_html__( 'Email Enquiry Contact Templates (Template Tags)', 'opalestate-pro' ),
- 'desc' => $contact_list_tags . '
',
- 'id' => 'opalestate_title_email_settings_6_1',
- 'type' => 'title',
+ 'name' => esc_html__( 'Email Enquiry Contact Templates (Template Tags)', 'opalestate-pro' ),
+ 'desc' => $contact_list_tags . '
',
+ 'id' => 'opalestate_title_email_settings_6_1',
+ 'type' => 'title',
+ 'before_row' => '
',
],
[
'id' => 'enquiry_email_subject',
@@ -460,10 +486,11 @@ class Opalestate_Emails {
],
/// email contact template ////
[
- 'name' => esc_html__( 'Email Contact Templates (Template Tags)', 'opalestate-pro' ),
- 'desc' => $contact_list_tags . '
',
- 'id' => 'opalestate_title_email_settings_6',
- 'type' => 'title',
+ 'name' => esc_html__( 'Email Contact Templates (Template Tags)', 'opalestate-pro' ),
+ 'desc' => $contact_list_tags . '
',
+ 'id' => 'opalestate_title_email_settings_6',
+ 'type' => 'title',
+ 'before_row' => '
',
],
[
'id' => 'contact_email_subject',
@@ -486,10 +513,11 @@ class Opalestate_Emails {
],
/// Email Request Review ///
[
- 'name' => esc_html__( 'Email Request Review Templates (Template Tags)', 'opalestate-pro' ),
- 'desc' => $review_list_tags . '
',
- 'id' => 'opalestate_title_email_settings_7',
- 'type' => 'title',
+ 'name' => esc_html__( 'Email Request Review Templates (Template Tags)', 'opalestate-pro' ),
+ 'desc' => $review_list_tags . '
',
+ 'id' => 'opalestate_title_email_settings_7',
+ 'type' => 'title',
+ 'before_row' => '
',
],
[
'id' => 'request_review_email_subject',
diff --git a/inc/class-opalestate-install.php b/inc/class-opalestate-install.php
index bed36653..27f73ac9 100755
--- a/inc/class-opalestate-install.php
+++ b/inc/class-opalestate-install.php
@@ -128,6 +128,10 @@ class Opalestate_Install {
$options['enable_agency_reviews'] = 'on';
$options['enable_agent_reviews'] = 'on';
+ $options['enable_customer_new_submission'] = 'on';
+ $options['enable_admin_new_submission'] = 'on';
+ $options['enable_approve_property_email'] = 'on';
+
$options['admin_approve'] = 'on';
$options['enable_submission_tab_media'] = 'on';
$options['enable_submission_tab_location'] = 'on';
diff --git a/inc/template-functions.php b/inc/template-functions.php
index a43d73e8..58813378 100755
--- a/inc/template-functions.php
+++ b/inc/template-functions.php
@@ -741,6 +741,10 @@ function opalestate_get_property_walkscore_results( $property ) {
$map = $property->get_map();
+ if ( ! $map || ! is_array( $map ) || ! isset( $map['latitude'] ) || ! isset( $map['longitude'] ) ) {
+ return false;
+ }
+
$latitude = $map['latitude'];
$longitude = $map['longitude'];
diff --git a/opal-estate-pro.php b/opal-estate-pro.php
index bc7d06e2..9fed86a9 100755
--- a/opal-estate-pro.php
+++ b/opal-estate-pro.php
@@ -3,11 +3,11 @@
* Plugin Name: Opal Estate Pro
* Plugin URI: https://wpdocs.gitbook.io/opal-estate/
* Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website.
- * Version: 1.1.9.3
+ * Version: 1.2
* Author: WPOPAL
* Author URI: http://www.wpopal.com
* Requires at least: 4.6
- * Tested up to: 5.2.3
+ * Tested up to: 5.3
* Text Domain: opalestate-pro
* Domain Path: languages/
*
@@ -151,7 +151,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
*/
public function __clone() {
// Cloning instances of the class is forbidden
- _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.1.9.3' );
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.2' );
}
/**
@@ -160,7 +160,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
public function setup_constants() {
// Plugin version
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
- define( 'OPALESTATE_VERSION', '1.1.9.3' );
+ define( 'OPALESTATE_VERSION', '1.2' );
}
// Plugin Folder Path
diff --git a/readme.txt b/readme.txt
index bf44ff1e..7f2f0d15 100755
--- a/readme.txt
+++ b/readme.txt
@@ -3,8 +3,8 @@ Contributors: wpopal
Donate link: https://wpdocs.gitbook.io/opal-estate/
Tags: estate, property, opalestate, house for rent, agency for lease, estate submission, agents estate property, property marketplace
Requires at least: 4.6
-Tested up to: 5.2.3
-Stable tag: 1.1.9.3
+Tested up to: 5.3
+Stable tag: 1.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -156,6 +156,10 @@ This section describes how to install the plugin and get it working.
* System tickets support 24/7 available : [free support](https://wpopal.ticksy.com/ "Visit the Plugin support Page")
== Changelog ==
+= 1.2 - 2019-12-04 =
+* Fixes - Login ajax.
+* Added - Enable email settings.
+
= 1.1.9.3 - 2019-11-27 =
* Fixes - Measurement Unit translation.
diff --git a/templates/single-property/nearby.php b/templates/single-property/nearby.php
index c7872bff..09d52c85 100755
--- a/templates/single-property/nearby.php
+++ b/templates/single-property/nearby.php
@@ -16,6 +16,10 @@ if ( ! $categories ) {
$map = $property->get_map();
+if ( ! $map || ! is_array( $map ) || ! isset( $map['latitude'] ) || ! isset( $map['longitude'] ) ) {
+ return;
+}
+
$latitude = $map['latitude'];
$longitude = $map['longitude'];
if ( ! $latitude || ! $longitude ) {