This commit is contained in:
Alpha 2020-07-21 08:36:32 +07:00
parent a5a053b025
commit 920a1cbe1a
9 changed files with 73 additions and 4 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1,3 +1,6 @@
= 1.6.3 - 2020-07-21 =
* Added - Login to show settings
= 1.6.2 - 2020-07-13 =
* Added - Search form general setting

BIN
inc/.DS_Store vendored

Binary file not shown.

View File

@ -573,6 +573,18 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
'after_row' => '<hr>',
];
$fields[] = [
'name' => esc_html__( 'Login to show Price', 'opalestate-pro' ),
'desc' => esc_html__( 'Require users login to show Price', 'opalestate-pro' ),
'id' => 'enable_single_login_to_show_price',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
'after_row' => '<hr>',
];
$fields[] = [
'name' => esc_html__( 'Show Author box', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Author box in the single property page.', 'opalestate-pro' ),
@ -605,6 +617,17 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Login to show Enquire form', 'opalestate-pro' ),
'desc' => esc_html__( 'Require users login to show Enquire form', 'opalestate-pro' ),
'id' => 'enable_single_login_to_enquire_form',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
'after_row' => '<hr>',
];

View File

@ -1326,6 +1326,18 @@ function opalestate_is_require_login_to_show_author_box() {
return ! ( $require == 'on' ) || ( $require == 'on' && is_user_logged_in() );
}
function opalestate_is_require_login_to_show_price() {
$require = opalestate_get_option( 'enable_single_login_to_show_price', 'off' );
return ! ( $require == 'on' ) || ( $require == 'on' && is_user_logged_in() );
}
function opalestate_is_require_login_to_show_enquire_form() {
$require = opalestate_get_option( 'enable_single_login_to_enquire_form', 'off' );
return ! ( $require == 'on' ) || ( $require == 'on' && is_user_logged_in() );
}
/**
* Clean variables using sanitize_text_field. Arrays are cleaned recursively.
* Non-scalar values are ignored.

View File

@ -3,7 +3,7 @@
* 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.6.2
* Version: 1.6.3
* Author: WPOPAL
* Author URI: http://www.wpopal.com
* Requires at least: 4.9
@ -154,7 +154,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
*/
public function __clone() {
// Cloning instances of the class is forbidden
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'opalestate-pro' ), '1.6.2' );
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'opalestate-pro' ), '1.6.3' );
}
/**
@ -163,7 +163,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
public function setup_constants() {
// Plugin version
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
define( 'OPALESTATE_VERSION', '1.6.2' );
define( 'OPALESTATE_VERSION', '1.6.3' );
}
// Plugin Folder Path

View File

@ -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
Requires at least: 4.9
Tested up to: 5.3.2
Stable tag: 1.6.2
Stable tag: 1.6.3
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -150,6 +150,15 @@ 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")
== Changelog ==
= 1.6.3 - 2020-07-21 =
* Added - Login to show settings
= 1.6.2 - 2020-07-13 =
* Added - Search form general setting
= 1.6.1 - 2020-07-07 =
* Fixes - Property collection sort order
= 1.6 - 2020-06-25 =
* Added - Related properties setting
* Added - Nearby properties setting

View File

@ -5,6 +5,18 @@ if ( opalestate_get_option( 'enable_single_enquire_form', 'on' ) !== 'on' ) {
return;
}
if ( ! opalestate_is_require_login_to_show_enquire_form() ) {
?>
<div class="opalestate-require-login-box">
<p class="opalestate-require-login-notice"><?php esc_html_e( 'You need to login to contact.', 'opalestate-pro' ); ?></p>
<a href="#opalestate-user-form-popup" class="opalestate-need-login button btn btn-primary btn-3d">
<?php esc_html_e( 'Login', 'opalestate-pro' ) ?>
</a>
</div>
<?php
return;
}
$property_id = get_the_ID();
$infor_id = apply_filters( 'opalestate_contact_form_infor_id', $property_id, $property_id );
$message = sprintf( __( 'Hi, I am interested in %s (Property ID: %s)', 'opalestate-pro' ), get_the_title(), $infor_id );

View File

@ -8,6 +8,16 @@ if ( ! defined( 'ABSPATH' ) ) {
global $property;
if ( ! opalestate_is_require_login_to_show_price() ) {
?>
<div class="opalestate-require-login-box">
<div class="opalestate-require-login-notice"><?php esc_html_e( 'You need to login to see the price.', 'opalestate-pro' ); ?>
<a href="#opalestate-user-form-popup" class="opalestate-need-login"><?php esc_html_e( 'Login', 'opalestate-pro' ) ?></a>
</div>
</div>
<?php
return;
}
?>
<div class="property-price">