Fix enquire email
This commit is contained in:
parent
9dfb0af9e9
commit
1245c12d50
@ -1,3 +1,6 @@
|
|||||||
|
= 1.4.9.8 - 2020-05-28 =
|
||||||
|
* Fixes - Enquire email.
|
||||||
|
|
||||||
= 1.4.9.4 - 2020-05-27 =
|
= 1.4.9.4 - 2020-05-27 =
|
||||||
* Fixes - Minor bugs.
|
* Fixes - Minor bugs.
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ class OpalEstate_User_Message {
|
|||||||
switch ( trim( $_POST['type'] ) ) {
|
switch ( trim( $_POST['type'] ) ) {
|
||||||
case 'send_equiry':
|
case 'send_equiry':
|
||||||
if ( wp_verify_nonce( $_POST['message_action'], 'send-enquiry-form' ) ) {
|
if ( wp_verify_nonce( $_POST['message_action'], 'send-enquiry-form' ) ) {
|
||||||
$member = $this->get_member_email_data( (int) $_POST['post_id'] );
|
$member = $this->get_member_email_data( absint( $_POST['post_id'] ) );
|
||||||
$content = $this->send_equiry( $_POST, $member );
|
$content = $this->send_equiry( $_POST, $member );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1,31 +1,65 @@
|
|||||||
<?php
|
<?php
|
||||||
function opalestate_get_message_by_user( $args=array() ){
|
function opalestate_get_message_by_user( $args = [] ) {
|
||||||
return array(
|
return [
|
||||||
'items' => OpalEstate_User_Message::get_instance()->get_list( $args ),
|
'items' => OpalEstate_User_Message::get_instance()->get_list( $args ),
|
||||||
'total' => OpalEstate_User_Message::get_instance()->get_total( $args )
|
'total' => OpalEstate_User_Message::get_instance()->get_total( $args ),
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function opalestate_get_member_email_data( $post_id ){
|
function opalestate_get_member_email_data( $post_id ) {
|
||||||
|
|
||||||
$output = array();
|
|
||||||
$type = get_post_meta( $post_id, OPALESTATE_PROPERTY_PREFIX . 'author_type', true );
|
$type = get_post_meta( $post_id, OPALESTATE_PROPERTY_PREFIX . 'author_type', true );
|
||||||
|
|
||||||
$receiver_id = 0;
|
$receiver_id = 0;
|
||||||
switch ( $type ) {
|
switch ( $type ) {
|
||||||
|
|
||||||
case 'agent':
|
case 'agent':
|
||||||
$related_id = get_post_meta( $post_id, OPALESTATE_PROPERTY_PREFIX . 'related_id', true );
|
$agent_id = get_post_meta( $post_id, OPALESTATE_PROPERTY_PREFIX . 'agent', true );
|
||||||
$post = get_post( $related_id );
|
if ( ! $agent_id ) {
|
||||||
|
$post = get_post( $post_id );
|
||||||
|
$user = get_user_by( 'id', $post->post_author );
|
||||||
|
$email = $user->data->user_email;
|
||||||
|
$name = $user->data->display_name;
|
||||||
|
$receiver_id = $post->post_author;
|
||||||
|
} else {
|
||||||
|
$user_id = get_post_meta( $agent_id, OPALESTATE_AGENT_PREFIX . 'user_id', true );
|
||||||
|
if ( $user_id ) {
|
||||||
|
$post = get_post( $post_id );
|
||||||
|
$user = get_user_by( 'id', $user_id );
|
||||||
|
$email = $user->data->user_email;
|
||||||
|
$name = $user->data->display_name;
|
||||||
|
$receiver_id = $post->post_author;
|
||||||
|
} else {
|
||||||
|
$post = get_post( $agent_id );
|
||||||
$name = $post->post_title;
|
$name = $post->post_title;
|
||||||
$email = get_post_meta( $related_id, OPALESTATE_AGENT_PREFIX . 'email', true );
|
$email = get_post_meta( $agent_id, OPALESTATE_AGENT_PREFIX . 'email', true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'agency':
|
case 'agency':
|
||||||
$related_id = get_post_meta( $post_id, OPALESTATE_PROPERTY_PREFIX . 'related_id', true );
|
$agency_id = get_post_meta( $post_id, OPALESTATE_PROPERTY_PREFIX . 'agency', true );
|
||||||
$agent = get_post( $related_id );
|
|
||||||
$name = $agent->post_title;
|
if ( ! $agency_id ) {
|
||||||
$email = get_post_meta( $related_id, OPALESTATE_AGENCY_PREFIX . 'email', true );
|
$post = get_post( $post_id );
|
||||||
|
$user = get_user_by( 'id', $post->post_author );
|
||||||
|
$email = $user->data->user_email;
|
||||||
|
$name = $user->data->display_name;
|
||||||
|
$receiver_id = $post->post_author;
|
||||||
|
} else {
|
||||||
|
$user_id = get_post_meta( $agency_id, OPALESTATE_AGENCY_PREFIX . 'user_id', true );
|
||||||
|
if ( $user_id ) {
|
||||||
|
$post = get_post( $post_id );
|
||||||
|
$user = get_user_by( 'id', $user_id );
|
||||||
|
$email = $user->data->user_email;
|
||||||
|
$name = $user->data->display_name;
|
||||||
|
$receiver_id = $post->post_author;
|
||||||
|
} else {
|
||||||
|
$post = get_post( $agency_id );
|
||||||
|
$name = $post->post_title;
|
||||||
|
$email = get_post_meta( $agency_id, OPALESTATE_AGENCY_PREFIX . 'email', true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$post = get_post( $post_id );
|
$post = get_post( $post_id );
|
||||||
@ -37,10 +71,9 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output = array(
|
return [
|
||||||
'receiver_email' => $email,
|
'receiver_email' => $email,
|
||||||
'receiver_name' => $name,
|
'receiver_name' => $name,
|
||||||
'receiver_id' => $receiver_id
|
'receiver_id' => $receiver_id,
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Plugin Name: Opal Estate Pro
|
* Plugin Name: Opal Estate Pro
|
||||||
* Plugin URI: https://wpdocs.gitbook.io/opal-estate/
|
* 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.
|
* Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website.
|
||||||
* Version: 1.4.9.4
|
* Version: 1.4.9.5
|
||||||
* Author: WPOPAL
|
* Author: WPOPAL
|
||||||
* Author URI: http://www.wpopal.com
|
* Author URI: http://www.wpopal.com
|
||||||
* Requires at least: 4.9
|
* Requires at least: 4.9
|
||||||
@ -150,7 +150,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
|
|||||||
*/
|
*/
|
||||||
public function __clone() {
|
public function __clone() {
|
||||||
// Cloning instances of the class is forbidden
|
// Cloning instances of the class is forbidden
|
||||||
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.4.9.4' );
|
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.4.9.5' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -159,7 +159,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
|
|||||||
public function setup_constants() {
|
public function setup_constants() {
|
||||||
// Plugin version
|
// Plugin version
|
||||||
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
|
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
|
||||||
define( 'OPALESTATE_VERSION', '1.4.9.4' );
|
define( 'OPALESTATE_VERSION', '1.4.9.5' );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plugin Folder Path
|
// Plugin Folder Path
|
||||||
|
@ -4,7 +4,7 @@ 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
|
Tags: estate, property, opalestate, house for rent, agency for lease, estate submission, agents estate property, property marketplace
|
||||||
Requires at least: 4.9
|
Requires at least: 4.9
|
||||||
Tested up to: 5.3.2
|
Tested up to: 5.3.2
|
||||||
Stable tag: 1.4.9.4
|
Stable tag: 1.4.9.5
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
@ -152,6 +152,9 @@ This section describes how to install the plugin and get it working.
|
|||||||
* System tickets support 24/7 available : [free support](https://themelexus.ticksy.com/ "Visit the Plugin support Page")
|
* System tickets support 24/7 available : [free support](https://themelexus.ticksy.com/ "Visit the Plugin support Page")
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
= 1.4.9.5 - 2020-05-28 =
|
||||||
|
* Fixes - Enquire email.
|
||||||
|
|
||||||
= 1.4.9.4 - 2020-05-27 =
|
= 1.4.9.4 - 2020-05-27 =
|
||||||
* Fixes - Minor bugs.
|
* Fixes - Minor bugs.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user