Fixes. Add mortgage single setting. Tag 1.5.1
This commit is contained in:
@@ -500,6 +500,17 @@ class Opalestate_Property_MetaBox {
|
||||
'options' => $templates,
|
||||
'description' => esc_html__( 'Select a layout to display full information of this property', 'opalestate-pro' ),
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Show Mortgage Calculator', 'opalestate-pro' ),
|
||||
'id' => "{$prefix}enable_single_mortgage",
|
||||
'type' => 'select',
|
||||
'options' => [
|
||||
'' => esc_html__( 'Inherit', 'opalestate-pro' ),
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'description' => esc_html__( 'Show Mortgage Calculator', 'opalestate-pro' ),
|
||||
],
|
||||
];
|
||||
|
||||
return apply_filters( 'opalestate_postype_property_metaboxes_fields_layout', $fields );
|
||||
|
||||
@@ -40,14 +40,19 @@ function opalestate_single_property_layout_default() {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v2', 5 );
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_equiry_form', 6 );
|
||||
|
||||
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
|
||||
$single_mortgage = get_post_meta( get_the_ID(), OPALESTATE_PROPERTY_PREFIX . 'enable_single_mortgage', true );
|
||||
|
||||
if ( $single_mortgage === 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
} elseif ( $single_mortgage === '' ) {
|
||||
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'opalestate_thumbnail_nav_column', function () {
|
||||
return 6;
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -74,8 +79,14 @@ function opalestate_single_property_layout_v2() {
|
||||
|
||||
add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 );
|
||||
|
||||
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
|
||||
$single_mortgage = get_post_meta( get_the_ID(), OPALESTATE_PROPERTY_PREFIX . 'enable_single_mortgage', true );
|
||||
|
||||
if ( $single_mortgage === 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
} elseif ( $single_mortgage === '' ) {
|
||||
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v3', 10 );
|
||||
@@ -112,8 +123,14 @@ function opalestate_single_property_layout_v3() {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v2', 5 );
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_equiry_form', 6 );
|
||||
|
||||
if ( opalestate_get_option( 'enable_single_mortgage' , 'on' ) == 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage' );
|
||||
$single_mortgage = get_post_meta( get_the_ID(), OPALESTATE_PROPERTY_PREFIX . 'enable_single_mortgage', true );
|
||||
|
||||
if ( $single_mortgage === 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
} elseif ( $single_mortgage === '' ) {
|
||||
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,8 +165,14 @@ function opalestate_single_property_layout_v4() {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v2', 5 );
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_equiry_form', 6 );
|
||||
|
||||
if ( opalestate_get_option( 'enable_single_mortgage' , 'on' ) == 'on' ) {
|
||||
$single_mortgage = get_post_meta( get_the_ID(), OPALESTATE_PROPERTY_PREFIX . 'enable_single_mortgage', true );
|
||||
|
||||
if ( $single_mortgage === 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
} elseif ( $single_mortgage === '' ) {
|
||||
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,8 +213,14 @@ function opalestate_single_property_layout_v5() {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v2', 5 );
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_equiry_form', 6 );
|
||||
|
||||
if ( opalestate_get_option( 'enable_single_mortgage' ,'on' ) == 'on' ) {
|
||||
$single_mortgage = get_post_meta( get_the_ID(), OPALESTATE_PROPERTY_PREFIX . 'enable_single_mortgage', true );
|
||||
|
||||
if ( $single_mortgage === 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
} elseif ( $single_mortgage === '' ) {
|
||||
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
|
||||
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,19 +365,20 @@ add_action( 'opalestate_before_property_loop_item', 'opalestate_property_label'
|
||||
*/
|
||||
function opalestate_single_property_sidebar_widgets() {
|
||||
if ( is_active_sidebar( 'opalestate-single-property' ) ) : ?>
|
||||
<div class="opalestate-single-property-widgets">
|
||||
<div class="opalestate-single-property-widgets">
|
||||
<?php dynamic_sidebar( 'opalestate-single-property' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
if ( 'off' === opalestate_get_option( 'hide_unset_amenities', 'off' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
add_filter( 'opalestate_hide_unset_amenity', 'opalestate_hide_unset_amenities' );
|
||||
|
||||
@@ -33,7 +33,6 @@ function opalestate_submssion_list_page( $args = [] ) {
|
||||
}
|
||||
|
||||
function opalestate_get_user_management_page_uri( $args = [] ) {
|
||||
|
||||
global $opalestate_options;
|
||||
|
||||
$uri = isset( $opalestate_options['user_management_page'] ) ? get_permalink( absint( $opalestate_options['user_management_page'] ) ) : get_bloginfo( 'url' );
|
||||
@@ -50,6 +49,14 @@ function opalestate_get_user_management_page_uri( $args = [] ) {
|
||||
return apply_filters( 'opalestate_user_management_page_uri', $uri );
|
||||
}
|
||||
|
||||
function opalestate_is_user_management_page() {
|
||||
global $opalestate_options;
|
||||
|
||||
$page_id = isset( $opalestate_options['user_management_page'] ) ? ( absint( $opalestate_options['user_management_page'] ) ) : 0;
|
||||
|
||||
return $page_id && is_page( $page_id );
|
||||
}
|
||||
|
||||
function opalestate_get_current_url( $args = [] ) {
|
||||
global $wp;
|
||||
if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
|
||||
@@ -162,12 +169,14 @@ function opalestate_management_user_menu_tabs() {
|
||||
|
||||
foreach ( $menu as $key => $item ) {
|
||||
if ( preg_match( "#http#", $item['link'] ) ) {
|
||||
$link = $item['link'];
|
||||
$link = $item['link'];
|
||||
$is_active = is_page( $item['id'] ) ? ' active' : '';
|
||||
} else {
|
||||
$link = $uri . '?tab=' . $item['link'];
|
||||
$link = $uri . '?tab=' . $item['link'];
|
||||
$is_active = isset( $_GET['tab'] ) && $current_tab == $item['link'] ? ' active' : '';
|
||||
}
|
||||
|
||||
$output .= '<li class="account-links-item ' . $key . ( $current_tab == $item['link'] ? ' active' : '' ) . '"><a href="' . $link . '"><i class="' . $item['icon'] . '"></i> ' . $item['title'] . '</a></li>';
|
||||
$output .= '<li class="account-links-item ' . $key . $is_active . '"><a href="' . $link . '"><i class="' . $item['icon'] . '"></i> ' . $item['title'] . '</a></li>';
|
||||
}
|
||||
|
||||
$output .= '<li><a href="' . wp_logout_url( home_url( '/' ) ) . '"> <i class="fa fa-unlock"></i> ' . esc_html__( 'Log out', 'opalestate-pro' ) . '</a></li>';
|
||||
@@ -211,7 +220,7 @@ function opalestate_get_user_dashboard_menus() {
|
||||
'icon' => 'far fa-star',
|
||||
'link' => 'reviews',
|
||||
'title' => esc_html__( 'Reviews', 'opalestate-pro' ),
|
||||
'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0,
|
||||
'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -220,7 +229,7 @@ function opalestate_get_user_dashboard_menus() {
|
||||
'icon' => 'fa fa-envelope',
|
||||
'link' => 'messages',
|
||||
'title' => esc_html__( 'Messages', 'opalestate-pro' ),
|
||||
'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0,
|
||||
'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -346,8 +355,8 @@ function opalestate_current_user_can_access_dashboard_page( $page = '' ) {
|
||||
* @return bool
|
||||
*/
|
||||
function opalestate_user_has_estate_roles( $user_id ) {
|
||||
$user_meta = get_userdata( $user_id );
|
||||
$roles = $user_meta->roles;
|
||||
$user_meta = get_userdata( $user_id );
|
||||
$roles = $user_meta->roles;
|
||||
$allowd_roles = opalestate_get_allowed_roles();
|
||||
|
||||
foreach ( $roles as $role ) {
|
||||
|
||||
4
inc/vendors/opalmembership/membership.php
vendored
4
inc/vendors/opalmembership/membership.php
vendored
@@ -305,7 +305,7 @@ class OpalEstate_Membership {
|
||||
'icon' => 'fa fa-user',
|
||||
'link' => opalmembership_get_payment_history_page_uri(),
|
||||
'title' => esc_html__( 'My Invoices', 'opalestate-pro' ),
|
||||
'id' => isset( $opalmembership_options['dashboard_page'] ) ? $opalmembership_options['dashboard_page'] : 0,
|
||||
'id' => isset( $opalmembership_options['history_page'] ) ? $opalmembership_options['history_page'] : 0,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ class OpalEstate_Membership {
|
||||
'icon' => 'fa fa-certificate',
|
||||
'link' => opalmembership_get_membership_page_uri(),
|
||||
'title' => esc_html__( 'Renew membership', 'opalestate-pro' ),
|
||||
'id' => isset( $opalmembership_options['dashboard_page'] ) ? $opalmembership_options['dashboard_page'] : 0,
|
||||
'id' => isset( $opalmembership_options['membership_page'] ) ? $opalmembership_options['membership_page'] : 0,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user