Add property settings
This commit is contained in:
parent
40bcb3b3b2
commit
ca997b7dde
@ -1,3 +1,7 @@
|
||||
= 1.3.5 - 2020-02-28 =
|
||||
* Added - Time format setting
|
||||
* Added - Hide unset amenities settings
|
||||
|
||||
= 1.3.4 - 2020-02-21 =
|
||||
* Fixes - Enquire email & Contact email
|
||||
|
||||
|
@ -226,6 +226,14 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'options' => opalestate_get_measurement_units(),
|
||||
'default' => 'sqft',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Time Format', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Select a time format.', 'opalestate-pro' ),
|
||||
'id' => 'time_format',
|
||||
'type' => 'select',
|
||||
'options' => opalestate_get_time_formats(),
|
||||
'default' => '12_hour',
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -361,6 +361,20 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'default' => 'on',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
'name' => esc_html__( 'Request Viewing Time Range (minute)', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Time range from 1-60 minutes.', 'opalestate-pro' ),
|
||||
'id' => 'request_viewing_time_range',
|
||||
'type' => 'text_small',
|
||||
'attributes' => [
|
||||
'type' => 'number',
|
||||
'min' => 1,
|
||||
'max' => 60,
|
||||
],
|
||||
'default' => 15,
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
'name' => esc_html__( 'Show Amenities tab', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show Amenities tab in the single property page.', 'opalestate-pro' ),
|
||||
@ -372,6 +386,18 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
],
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
'name' => esc_html__( 'Hide Unset amenities', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Hide unset amenities. Default: Show unset amenities with disable icons.', 'opalestate-pro' ),
|
||||
'id' => 'hide_unset_amenities',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
'name' => esc_html__( 'Show Facilities tab', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show Facilities tab in the single property page.', 'opalestate-pro' ),
|
||||
@ -381,6 +407,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -392,6 +419,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -403,6 +431,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -414,6 +443,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -425,6 +455,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -436,6 +467,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -447,6 +479,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -458,6 +491,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -469,6 +503,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -493,6 +528,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'max' => 365,
|
||||
],
|
||||
'default' => 8,
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -515,6 +551,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -526,6 +563,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -537,6 +575,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -545,6 +584,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'id' => 'single_related_properties_layout',
|
||||
'type' => 'select',
|
||||
'options' => opalestate_get_loop_property_layouts(),
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
$fields[] = [
|
||||
@ -553,6 +593,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'id' => 'single_nearby_properties_layout',
|
||||
'type' => 'select',
|
||||
'options' => opalestate_get_loop_property_layouts(),
|
||||
'after_row' => '<hr>',
|
||||
];
|
||||
|
||||
return $fields;
|
||||
|
@ -712,7 +712,7 @@ class OpalEstate_User_Message {
|
||||
'id' => "{$prefix}time",
|
||||
'name' => esc_html__( 'Time', 'opalestate-pro' ),
|
||||
'type' => 'select',
|
||||
'options' => opalestate_get_time_lapses(),
|
||||
'options' => opalestate_get_request_viewing_time_list(),
|
||||
],
|
||||
[
|
||||
'id' => "{$prefix}phone",
|
||||
|
@ -133,8 +133,14 @@ function opalestate_upload_base64_image( $file, $parent_id = 0 ) {
|
||||
return $attach_id;
|
||||
}
|
||||
|
||||
function opalestate_get_request_viewing_time_list() {
|
||||
$range_time = opalestate_get_option( 'request_viewing_time_range', 15 );
|
||||
|
||||
return apply_filters( 'opalestate_request_viewing_time_list', opalestate_get_time_lapses( $range_time ) );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets time lapses.
|
||||
*/
|
||||
function opalestate_get_time_lapses( $lapse = 15 ) {
|
||||
|
||||
@ -147,8 +153,19 @@ function opalestate_get_time_lapses( $lapse = 15 ) {
|
||||
$end_str = strtotime( $end );
|
||||
$now_str = $start_str;
|
||||
|
||||
$time_format_value = 'h:i a';
|
||||
$time_format_show = 'h:i A';
|
||||
|
||||
if ( '24_hour' === opalestate_get_option( 'time_format' ) ) {
|
||||
$time_format_value = 'H:i';
|
||||
$time_format_show = 'H:i';
|
||||
}
|
||||
|
||||
$time_format_value = apply_filters( 'opalestate_time_lapse_value', $time_format_value );
|
||||
$time_format_show = apply_filters( 'opalestate_time_lapse_show', $time_format_show );
|
||||
|
||||
while ( $now_str <= $end_str ) {
|
||||
$output[ date( 'h:i a', $now_str ) ] = date( 'h:i A', $now_str );
|
||||
$output[ date( $time_format_value, $now_str ) ] = date( $time_format_show, $now_str );
|
||||
$now_str = strtotime( $interval, $now_str );
|
||||
}
|
||||
|
||||
@ -1199,7 +1216,7 @@ add_action( 'opalestate_after_search_properties_form', 'opalestate_add_hidden_mu
|
||||
* @return array
|
||||
*/
|
||||
function opalestate_get_measurement_units() {
|
||||
return apply_filters( 'opalestate_measurement_unit', [
|
||||
return apply_filters( 'opalestate_measurement_units', [
|
||||
'sqft' => esc_html__( 'sq ft', 'opalestate-pro' ),
|
||||
'sqm' => esc_html__( 'sq m', 'opalestate-pro' ),
|
||||
'mq' => esc_html__( 'mq', 'opalestate-pro' ),
|
||||
@ -1207,6 +1224,18 @@ function opalestate_get_measurement_units() {
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets time formats.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function opalestate_get_time_formats() {
|
||||
return apply_filters( 'opalestate_time_formats', [
|
||||
'12_hour' => esc_html__( '12-hour', 'opalestate-pro' ),
|
||||
'24_hour' => esc_html__( '24-hour', 'opalestate-pro' ),
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns property statuses.
|
||||
*
|
||||
|
@ -343,3 +343,12 @@ function opalestate_single_property_sidebar_widgets() {
|
||||
}
|
||||
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_single_property_sidebar_widgets', 99 );
|
||||
|
||||
function opalestate_hide_unset_amenities( $show ) {
|
||||
if ( 'off' === opalestate_get_option( 'hide_unset_amenities', 'off' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
add_filter( 'opalestate_hide_unset_amenity', 'opalestate_hide_unset_amenities' );
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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.3.4
|
||||
* Version: 1.3.5
|
||||
* Author: WPOPAL
|
||||
* Author URI: http://www.wpopal.com
|
||||
* Requires at least: 4.9
|
||||
@ -150,7 +150,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.3.4' );
|
||||
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.3.5' );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -159,7 +159,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
|
||||
public function setup_constants() {
|
||||
// Plugin version
|
||||
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
|
||||
define( 'OPALESTATE_VERSION', '1.3.4' );
|
||||
define( 'OPALESTATE_VERSION', '1.3.5' );
|
||||
}
|
||||
|
||||
// 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
|
||||
Requires at least: 4.9
|
||||
Tested up to: 5.3.2
|
||||
Stable tag: 1.3.4
|
||||
Stable tag: 1.3.5
|
||||
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.3.5 - 2020-02-28 =
|
||||
* Added - Time format setting
|
||||
* Added - Hide unset amenities settings
|
||||
|
||||
= 1.3.4 - 2020-02-21 =
|
||||
* Fixes - Enquire email & Contact email
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user