diff --git a/inc/admin/class-admin.php b/inc/admin/class-admin.php
index bb649a54..8033b02c 100755
--- a/inc/admin/class-admin.php
+++ b/inc/admin/class-admin.php
@@ -86,6 +86,7 @@ class Opalestate_Admin {
'settings/searcharea.php',
'settings/general.php',
'settings/property.php',
+ 'settings/pages.php',
] );
// Get it started
diff --git a/inc/admin/register-settings.php b/inc/admin/register-settings.php
index 42f11791..2ef35dc2 100755
--- a/inc/admin/register-settings.php
+++ b/inc/admin/register-settings.php
@@ -115,10 +115,12 @@ class Opalestate_Plugin_Settings {
$settings = $this->opalestate_settings( null );
- $tabs = [];
- $tabs['general'] = esc_html__( 'General', 'opalestate-pro' );
-
- $tabs['property'] = esc_html__( 'Property', 'opalestate-pro' );
+ $tabs = [];
+ $tabs['general'] = esc_html__( 'General', 'opalestate-pro' );
+ $tabs['property'] = esc_html__( 'Property', 'opalestate-pro' );
+ $tabs['pages'] = esc_html__( 'Pages', 'opalestate-pro' );
+ $tabs['3rd_party'] = esc_html__( '3rd Party', 'opalestate-pro' );
+ $tabs['api_keys'] = esc_html__( 'API', 'opalestate-pro' );
if ( ! empty( $settings['addons']['fields'] ) ) {
$tabs['addons'] = esc_html__( 'Add-ons', 'opalestate-pro' );
@@ -128,9 +130,6 @@ class Opalestate_Plugin_Settings {
$tabs['licenses'] = esc_html__( 'Licenses', 'opalestate-pro' );
}
- $tabs['api_keys'] = esc_html__( 'API', 'opalestate-pro' );
- $tabs['3rd_party'] = esc_html__( '3rd Party', 'opalestate-pro' );
-
return apply_filters( 'opalestate_settings_tabs', $tabs );
}
diff --git a/inc/admin/settings/general.php b/inc/admin/settings/general.php
index 52f68380..e08f4c64 100755
--- a/inc/admin/settings/general.php
+++ b/inc/admin/settings/general.php
@@ -32,11 +32,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
}
public function get_tab_fields( $key = '' ) {
- $pages = opalestate_cmb2_get_post_options( [
- 'post_type' => 'page',
- 'numberposts' => -1,
- ] );
-
return apply_filters( 'opalestate_settings_general', [
[
'name' => esc_html__( 'General Settings', 'opalestate-pro' ),
@@ -46,44 +41,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'before_row' => '
',
'after_row' => '
',
],
- [
- 'name' => esc_html__( 'User Management Page', 'opalestate-pro' ),
- 'desc' => esc_html__( 'This is page use User Management Page using for show content of management page such as profile, my properties', 'opalestate-pro' ),
- 'id' => 'user_management_page',
- 'type' => 'select',
- 'options' => $pages,
- ],
- [
- 'name' => esc_html__( 'Dashboard Logo', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Upload a logo for user dashboard page.', 'opalestate-pro' ),
- 'id' => 'dashboard_logo',
- 'type' => 'file',
- 'preview_size' => [ 100, 100 ],
- 'options' => [
- 'url' => false,
- ],
- 'query_args' => [
- 'type' => [
- 'image/gif',
- 'image/jpeg',
- 'image/png',
- ],
- ],
- ],
- [
- 'name' => esc_html__( 'My Account Page', 'opalestate-pro' ),
- 'desc' => esc_html__( 'This is page used for login and register an account, or reset password.', 'opalestate-pro' ),
- 'id' => 'user_myaccount_page',
- 'type' => 'select',
- 'options' => $pages,
- ],
- [
- 'name' => esc_html__( 'Terms and Conditions Page', 'opalestate-pro' ),
- 'desc' => esc_html__( 'This is page used for terms and conditions.', 'opalestate-pro' ),
- 'id' => 'user_terms_page',
- 'type' => 'select',
- 'options' => $pages,
- ],
[
'name' => esc_html__( 'Login and Redirect to Dashboard page', 'opalestate-pro' ),
'desc' => esc_html__( 'Redirect to User Management Dashboard page after login.', 'opalestate-pro' ),
@@ -104,19 +61,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
],
- [
- 'name' => esc_html__( 'Enable Message Database', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Allow User send message Contact/Equire via email and saved into database to exchange theirs message direct in User Message Management',
- 'opalestate-pro' ),
- 'id' => 'message_log',
- 'type' => 'switch',
- 'options' => [
- 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
- 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
- ],
-
- ],
-
[
'name' => esc_html__( 'Maximum Upload Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'Set maximum volumn size having < x MB', 'opalestate-pro' ),
diff --git a/inc/admin/settings/pages.php b/inc/admin/settings/pages.php
new file mode 100644
index 00000000..f06b8f33
--- /dev/null
+++ b/inc/admin/settings/pages.php
@@ -0,0 +1,176 @@
+
+ * @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved.
+ * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * @website http://www.wpopal.com
+ * @support http://www.wpopal.com/support/forum.html
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly
+}
+
+class Opalestate_Settings_Pages_Tab extends Opalestate_Settings_Base_Tab {
+
+ public function get_tabnav() {
+
+ }
+
+ public function get_tab_content( $key = '' ) {
+ return [
+ 'id' => 'options_page',
+ 'opalestate_title' => esc_html__( 'Pages', 'opalestate-pro' ),
+ 'show_on' => [ 'key' => 'options-page', 'value' => [ $key, ], ],
+ 'fields' => $this->get_tab_fields(),
+ ];
+ }
+
+ public function get_tab_fields( $key = '' ) {
+ $pages = opalestate_cmb2_get_post_options( [
+ 'post_type' => 'page',
+ 'numberposts' => -1,
+ ] );
+
+ return apply_filters( 'opalestate_settings_pages', [
+ [
+ 'name' => esc_html__( 'Pages Settings', 'opalestate-pro' ),
+
+ 'type' => 'opalestate_title',
+ 'id' => 'opalestate_title_pages_settings',
+ 'before_row' => '
',
+ 'after_row' => '
',
+ ],
+ [
+ 'name' => esc_html__( 'User Management Page', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'This is page use User Management Page using for show content of management page such as profile, my properties', 'opalestate-pro' ),
+ 'id' => 'user_management_page',
+ 'type' => 'select',
+ 'options' => $pages,
+ ],
+ [
+ 'name' => esc_html__( 'Dashboard Logo', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Upload a logo for user dashboard page.', 'opalestate-pro' ),
+ 'id' => 'dashboard_logo',
+ 'type' => 'file',
+ 'preview_size' => [ 100, 100 ],
+ 'options' => [
+ 'url' => false,
+ ],
+ 'query_args' => [
+ 'type' => [
+ 'image/gif',
+ 'image/jpeg',
+ 'image/png',
+ ],
+ ],
+ ],
+ [
+ 'name' => esc_html__( 'My Account Page', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'This is page used for login and register an account, or reset password.', 'opalestate-pro' ),
+ 'id' => 'user_myaccount_page',
+ 'type' => 'select',
+ 'options' => $pages,
+ ],
+ [
+ 'name' => esc_html__( 'Terms and Conditions Page', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'This is page used for terms and conditions.', 'opalestate-pro' ),
+ 'id' => 'user_terms_page',
+ 'type' => 'select',
+ 'options' => $pages,
+ ],
+ [
+ 'name' => esc_html__( 'Dashboard Settings', 'opalestate-pro' ),
+
+ 'type' => 'opalestate_title',
+ 'id' => 'opalestate_title_pages_dashboard',
+ 'desc' => esc_html__( 'Settings for User Management Dashboard.', 'opalestate-pro' ),
+ 'before_row' => '
',
+ 'after_row' => '
',
+ ],
+ [
+ 'name' => esc_html__( 'Show Profile', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Show Profile menu page.', 'opalestate-pro' ),
+ 'id' => 'enable_dashboard_profile',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
+ ],
+ [
+ 'name' => esc_html__( 'Show Favorite', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Show Favorite menu page.', 'opalestate-pro' ),
+ 'id' => 'enable_dashboard_favorite',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
+ ],
+ [
+ 'name' => esc_html__( 'Show Reviews', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Show Reviews menu page.', 'opalestate-pro' ),
+ 'id' => 'enable_dashboard_reviews',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
+ ],
+ [
+ 'name' => esc_html__( 'Enable Message Database', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Allow User send message Contact/Equire via email and saved into database to exchange theirs message direct in User Message Management',
+ 'opalestate-pro' ),
+ 'id' => 'message_log',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ ],
+ [
+ 'name' => esc_html__( 'Show Submission', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Show Submission menu page.', 'opalestate-pro' ),
+ 'id' => 'enable_dashboard_submission',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
+ ],
+ [
+ 'name' => esc_html__( 'Show Properties', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Show My Properties menu page.', 'opalestate-pro' ),
+ 'id' => 'enable_dashboard_properties',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
+ ],
+ [
+ 'name' => esc_html__( 'Show Saved Search', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Show Saved Search menu page.', 'opalestate-pro' ),
+ 'id' => 'enable_dashboard_savedsearch',
+ 'type' => 'switch',
+ 'options' => [
+ 'on' => esc_html__( 'Enable', 'opalestate-pro' ),
+ 'off' => esc_html__( 'Disable', 'opalestate-pro' ),
+ ],
+ 'default' => 'on',
+ ],
+ ]
+ );
+ }
+}
diff --git a/inc/user/class-opalestate-user-search.php b/inc/user/class-opalestate-user-search.php
index 406dc1be..828d603c 100755
--- a/inc/user/class-opalestate-user-search.php
+++ b/inc/user/class-opalestate-user-search.php
@@ -188,12 +188,14 @@ class OpalEstate_User_Search {
*
*/
public function dashboard_menu( $menu ) {
- $menu['savedsearch'] = [
- 'icon' => 'fa fa-search',
- 'link' => 'saved_search',
- 'title' => esc_html__( 'Saved Search', 'opalestate-pro' ),
- 'id' => 0,
- ];
+ if ( 'on' === opalestate_get_option( 'enable_dashboard_savedsearch', 'on' ) ) {
+ $menu['savedsearch'] = [
+ 'icon' => 'fa fa-search',
+ 'link' => 'saved_search',
+ 'title' => esc_html__( 'Saved Search', 'opalestate-pro' ),
+ 'id' => 0,
+ ];
+ }
return $menu;
}
diff --git a/inc/user/functions.php b/inc/user/functions.php
index f91c1ca4..76ab8aa3 100755
--- a/inc/user/functions.php
+++ b/inc/user/functions.php
@@ -69,10 +69,10 @@ function opalestate_get_user_tab_uri( $tab ) {
function opalestate_management_show_content_page_tab() {
-
- $tab = isset( $_GET['tab'] ) && $_GET['tab'] ? sanitize_text_field( $_GET['tab'] ) : 'dashboard';
-
- $fnc = 'opalestate_user_content_' . $tab . '_page';
+ $tab = isset( $_GET['tab'] ) && $_GET['tab'] ? sanitize_text_field( $_GET['tab'] ) : 'dashboard';
+ $tab_hook = $tab;
+ $tab_hook = apply_filters( 'opalestate_user_content_tab_hook', $tab_hook, $tab );
+ $fnc = 'opalestate_user_content_' . $tab_hook . '_page';
$content = apply_filters( $fnc, '' );
@@ -144,64 +144,7 @@ function opalestate_management_user_menu() {
function opalestate_management_user_menu_tabs() {
-
- global $opalestate_options;
- $menu = [];
-
- $menu['dashboard'] = [
- 'icon' => 'fas fa-chart-line',
- 'link' => 'dashboard',
- 'title' => esc_html__( 'Dashboard', 'opalestate-pro' ),
- 'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0,
- ];
-
- $menu['profile'] = [
- 'icon' => 'far fa-user',
- 'link' => 'profile',
- 'title' => esc_html__( 'Personal Information', 'opalestate-pro' ),
- 'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0,
- ];
-
- $menu['favorite'] = [
- 'icon' => 'far fa-heart',
- 'link' => 'favorite',
- 'title' => esc_html__( 'Favorite', 'opalestate-pro' ),
- 'id' => isset( $opalestate_options['favorite_page'] ) ? $opalestate_options['favorite_page'] : 0,
- ];
-
- $menu['reviews'] = [
- 'icon' => 'far fa-star',
- 'link' => 'reviews',
- 'title' => esc_html__( 'Reviews', 'opalestate-pro' ),
- 'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0,
- ];
-
- if ( opalestate_get_option( 'message_log' ) ) {
- $menu['messages'] = [
- 'icon' => 'fa fa-envelope',
- 'link' => 'messages',
- 'title' => esc_html__( 'Messages', 'opalestate-pro' ),
- 'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0,
- ];
- }
-
- $menu['submission'] = [
- 'icon' => 'fa fa-upload',
- 'link' => 'submission',
- 'title' => esc_html__( 'Submit Property', 'opalestate-pro' ),
- 'id' => isset( $opalestate_options['submission_page'] ) ? $opalestate_options['submission_page'] : 0,
- ];
-
- $statistics = new OpalEstate_User_Statistics();
-
- $menu['myproperties'] = [
- 'icon' => 'fas fa-building',
- 'link' => 'submission_list',
- 'title' => esc_html__( 'My Properties', 'opalestate-pro' ) . '' . $statistics->get_count_properties() . '',
- 'id' => isset( $opalestate_options['submission_list_page'] ) ? $opalestate_options['submission_list_page'] : 0,
- ];
-
- $menu = apply_filters( 'opalestate_management_user_menu', $menu );
+ $menu = opalestate_get_user_dashboard_menus();
$output = '';
@@ -228,6 +171,76 @@ function opalestate_management_user_menu_tabs() {
echo $output;
}
+function opalestate_get_user_dashboard_menus() {
+ global $opalestate_options;
+ $menu = [];
+
+ $menu['dashboard'] = [
+ 'icon' => 'fas fa-chart-line',
+ 'link' => 'dashboard',
+ 'title' => esc_html__( 'Dashboard', 'opalestate-pro' ),
+ 'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0,
+ ];
+
+ if ( 'on' === opalestate_get_option( 'enable_dashboard_profile', 'on' ) ) {
+ $menu['profile'] = [
+ 'icon' => 'far fa-user',
+ 'link' => 'profile',
+ 'title' => esc_html__( 'Personal Information', 'opalestate-pro' ),
+ 'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0,
+ ];
+ }
+
+ if ( 'on' === opalestate_get_option( 'enable_dashboard_favorite', 'on' ) ) {
+ $menu['favorite'] = [
+ 'icon' => 'far fa-heart',
+ 'link' => 'favorite',
+ 'title' => esc_html__( 'Favorite', 'opalestate-pro' ),
+ 'id' => isset( $opalestate_options['favorite_page'] ) ? $opalestate_options['favorite_page'] : 0,
+ ];
+ }
+
+ if ( 'on' === opalestate_get_option( 'enable_dashboard_reviews', 'on' ) ) {
+ $menu['reviews'] = [
+ 'icon' => 'far fa-star',
+ 'link' => 'reviews',
+ 'title' => esc_html__( 'Reviews', 'opalestate-pro' ),
+ 'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0,
+ ];
+ }
+
+ if ( 'on' === opalestate_get_option( 'message_log', 'on' ) ) {
+ $menu['messages'] = [
+ 'icon' => 'fa fa-envelope',
+ 'link' => 'messages',
+ 'title' => esc_html__( 'Messages', 'opalestate-pro' ),
+ 'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0,
+ ];
+ }
+
+ if ( 'on' === opalestate_get_option( 'enable_dashboard_submission', 'on' ) ) {
+ $menu['submission'] = [
+ 'icon' => 'fa fa-upload',
+ 'link' => 'submission',
+ 'title' => esc_html__( 'Submit Property', 'opalestate-pro' ),
+ 'id' => isset( $opalestate_options['submission_page'] ) ? $opalestate_options['submission_page'] : 0,
+ ];
+ }
+
+ if ( 'on' === opalestate_get_option( 'enable_dashboard_properties', 'on' ) ) {
+ $statistics = new OpalEstate_User_Statistics();
+
+ $menu['myproperties'] = [
+ 'icon' => 'fas fa-building',
+ 'link' => 'submission_list',
+ 'title' => esc_html__( 'My Properties', 'opalestate-pro' ) . '' . $statistics->get_count_properties() . '',
+ 'id' => isset( $opalestate_options['submission_list_page'] ) ? $opalestate_options['submission_list_page'] : 0,
+ ];
+ }
+
+ return apply_filters( 'opalestate_management_user_menu', $menu );
+}
+
function opalestate_user_content_dashboard_page() {
echo opalestate_load_template_path( 'user/dashboard' );
}
diff --git a/opal-estate-pro.php b/opal-estate-pro.php
index 54e96d48..6d56794c 100755
--- a/opal-estate-pro.php
+++ b/opal-estate-pro.php
@@ -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.2.7
+ * Version: 1.2.8
* Author: WPOPAL
* Author URI: http://www.wpopal.com
* Requires at least: 4.9
@@ -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.2.7' );
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.2.8' );
}
/**
@@ -160,7 +160,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
public function setup_constants() {
// Plugin version
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
- define( 'OPALESTATE_VERSION', '1.2.7' );
+ define( 'OPALESTATE_VERSION', '1.2.8' );
}
// Plugin Folder Path
diff --git a/readme.txt b/readme.txt
index cfca9c5f..92fdf3dd 100755
--- a/readme.txt
+++ b/readme.txt
@@ -156,6 +156,9 @@ 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.8 - 2020-01-06 =
+* Added - Pages settings.
+
= 1.2.7 - 2020-01-02 =
* Added - Redirect to User Dashboard page after login/register setting.