diff --git a/.DS_Store b/.DS_Store index 8449ada3..6614a507 100755 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/inc/admin/property/class-property.php b/inc/admin/property/class-property.php index 17e904eb..77b90964 100755 --- a/inc/admin/property/class-property.php +++ b/inc/admin/property/class-property.php @@ -38,6 +38,7 @@ class Opalestate_Admin_Property { // add_action( 'transition_post_status', array( __CLASS__, 'save_post' ), 10, 3 ); } + /** * */ diff --git a/inc/agency/class-opalestate-agency-front.php b/inc/agency/class-opalestate-agency-front.php index 16519320..f0301859 100755 --- a/inc/agency/class-opalestate-agency-front.php +++ b/inc/agency/class-opalestate-agency-front.php @@ -310,11 +310,29 @@ class Opalestate_Agency_Front { public function register_shortcodes() { $this->shortcodes = [ 'search_agencies' => [ 'code' => 'search_agencies', 'label' => esc_html__( 'Search Agencies', 'opalestate-pro' ) ], + 'agency_carousel' => [ 'code' => 'agency_carousel', 'label' => esc_html__( 'Agency Carousel', 'opalestate-pro' ) ], ]; foreach ( $this->shortcodes as $shortcode ) { add_shortcode( 'opalestate_' . $shortcode['code'], [ $this, $shortcode['code'] ] ); } + } + + public function agency_carousel ( $atts ) { + + $atts = is_array( $atts ) ? $atts : []; + + $default = array( + 'current_uri' => null, + 'column' => 3, + 'limit' => 12, + 'paged' => 1, + 'onlyfeatured' => 0, + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/agency-carousel' , $atts ); } /** diff --git a/inc/agency/class-opalestate-agency-query.php b/inc/agency/class-opalestate-agency-query.php index 068ce992..4dadfe4b 100755 --- a/inc/agency/class-opalestate-agency-query.php +++ b/inc/agency/class-opalestate-agency-query.php @@ -5,7 +5,7 @@ * @version $Id$ * @package $package$ * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @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 diff --git a/inc/agent/class-opalestate-agent-front.php b/inc/agent/class-opalestate-agent-front.php index d26f5b75..b366b1f6 100755 --- a/inc/agent/class-opalestate-agent-front.php +++ b/inc/agent/class-opalestate-agent-front.php @@ -3,7 +3,7 @@ * Opalestate_Agent_Front * * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. */ // Exit if accessed directly @@ -307,14 +307,34 @@ class Opalestate_Agent_Front { 'change_agent_profile' => [ 'code' => 'change_agent_profile', 'label' => esc_html__( 'Agent Profile', 'opalestate-pro' ) ], 'search_agents' => [ 'code' => 'search_agents', 'label' => esc_html__( 'Search Agents', 'opalestate-pro' ) ], + 'agent_carousel' => [ 'code' => 'agent_carousel', 'label' => esc_html__( 'Agent Carousel', 'opalestate-pro' ) ], ]; - foreach ( $this->shortcodes as $shortcode ) { + foreach ( $this->shortcodes as $shortcode ) { add_shortcode( 'opalestate_' . $shortcode['code'], [ $this, $shortcode['code'] ] ); } } + public function agent_carousel ( $atts ) { + + $atts = is_array( $atts ) ? $atts : []; + $layout = 'search-agency-form'; + + $default = array( + 'current_uri' => null, + 'column' => 4, + 'limit' => 12, + 'paged' => 1, + 'onlyfeatured' => 0, + 'form' => $layout + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/agent-carousel' , $atts ); + } + public function archives_query( $query ) { if ( $query->is_main_query() && is_post_type_archive( 'opalestate_agent' ) ) { diff --git a/inc/agent/class-opalestate-agent-query.php b/inc/agent/class-opalestate-agent-query.php index 0258be50..4935b51d 100755 --- a/inc/agent/class-opalestate-agent-query.php +++ b/inc/agent/class-opalestate-agent-query.php @@ -5,7 +5,7 @@ * @version $Id$ * @package $package$ * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @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 diff --git a/inc/class-opalestate-email.php b/inc/class-opalestate-email.php index 83da6c80..7628d466 100755 --- a/inc/class-opalestate-email.php +++ b/inc/class-opalestate-email.php @@ -5,7 +5,7 @@ * @version $Id$ * @package $package$ * @author Opal Team - * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. + * @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 @@ -287,6 +287,9 @@ class Opalestate_Emails { ], + //------------------------------------------ + + [ 'name' => esc_html__( 'Notification For New Property Submission', 'opalestate-pro' ), 'desc' => '
', @@ -354,7 +357,32 @@ class Opalestate_Emails { 'desc' => esc_html__( 'Enter the email a user should receive when they make an initial payment request.', 'opalestate-pro' ), 'default' => OpalEstate_Send_Email_Approve::get_default_template(), ], + /// enquire contact template //// + [ + 'name' => esc_html__( 'Email Enquiry Contact Templates (Template Tags)', 'opalestate-pro' ), + 'desc' => $contact_list_tags . '

', + 'id' => 'opalestate_title_email_settings_6_1', + 'type' => 'title', + ], + [ + 'id' => 'enquiry_email_subject', + 'name' => esc_html__( 'Email Subject', 'opalestate-pro' ), + 'type' => 'text', + 'desc' => esc_html__( 'The email subject a user should receive when they make an initial property request.', 'opalestate-pro' ), + 'attributes' => [ + 'placeholder' => 'Your property at I Love WordPress is pending', + get_bloginfo( 'name' ), + 'rows' => 3, + ], + 'default' => esc_html__( 'You got a message', 'opalestate-pro' ), + ], + [ + 'id' => 'enquiry_email_body', + 'name' => esc_html__( 'Email Body', 'opalestate-pro' ), + 'type' => 'wysiwyg', + 'default' => OpalEstate_Send_Email_Notification::get_default_template( 'enquiry' ) + ], /// email contact template //// [ 'name' => esc_html__( 'Email Contact Templates (Template Tags)', 'opalestate-pro' ), @@ -362,7 +390,6 @@ class Opalestate_Emails { 'id' => 'opalestate_title_email_settings_6', 'type' => 'title', ], - [ 'id' => 'contact_email_subject', 'name' => esc_html__( 'Email Subject', 'opalestate-pro' ), @@ -380,15 +407,33 @@ class Opalestate_Emails { 'id' => 'contact_email_body', 'name' => esc_html__( 'Email Body', 'opalestate-pro' ), 'type' => 'wysiwyg', - 'desc' => trim( preg_replace( '/\t+/', '', "Hi {receive_name},
- You have got message from {name} with email {email}. Here is detail: -
-
- {message} -
-  
-
- This message was sent by {site_link} on {current_time}." ) ), + 'default' => OpalEstate_Send_Email_Notification::get_default_template() + ], + /// Email Request Review /// + [ + 'name' => esc_html__( 'Email Request Review Templates (Template Tags)', 'opalestate-pro' ), + 'desc' => $contact_list_tags . '

', + 'id' => 'opalestate_title_email_settings_7', + 'type' => 'title', + ], + [ + 'id' => 'request_review_email_subject', + 'name' => esc_html__( 'Email Subject', 'opalestate-pro' ), + 'type' => 'text', + 'desc' => esc_html__( 'The email subject a user should receive when they make an initial property request.', 'opalestate-pro' ), + 'attributes' => [ + 'placeholder' => 'Your property at I Love WordPress is pending', + get_bloginfo( 'name' ), + 'rows' => 3, + ], + 'default' =>esc_html__( 'You have a message request reviewing at: %s', 'opalestate-pro' ), + ], + + [ + 'id' => 'request_review_email_body', + 'name' => esc_html__( 'Email Body', 'opalestate-pro' ), + 'type' => 'wysiwyg', + 'default' => OpalEstate_Send_Email_Request_Reviewing::get_default_template() ], ] ), diff --git a/inc/class-opalestate-enqueue.php b/inc/class-opalestate-enqueue.php index bd4633f7..9c66857d 100755 --- a/inc/class-opalestate-enqueue.php +++ b/inc/class-opalestate-enqueue.php @@ -103,6 +103,7 @@ class OpalEstate_Enqueue { * Register and enqueue javascript, css library */ public function register_enqueue() { + wp_register_script( 'jquery-modernizr', OPALESTATE_PLUGIN_URL . '/assets/3rd/magnific-popup/jquery.magnific-popup.min.js', @@ -112,6 +113,7 @@ class OpalEstate_Enqueue { '4.4.3', true ); + wp_enqueue_script( 'jquery-magnific-popup' ); wp_register_script( 'jquery-sticky-kit', trailingslashit( OPALESTATE_PLUGIN_URL ) . 'assets/3rd/sticky/jquery.sticky-kit.min.js', [], null, true ); wp_enqueue_script( 'jquery-sticky-kit' ); @@ -124,6 +126,7 @@ class OpalEstate_Enqueue { wp_enqueue_script( 'jquery-toast' ); + wp_register_script( 'jquery-swiper', OPALESTATE_PLUGIN_URL . '/assets/3rd/swiper/js/swiper.min.js', @@ -132,8 +135,12 @@ class OpalEstate_Enqueue { ], '4.4.3', true - ); - + ); + + if( !defined("ELEMENTOR_VERSION") ) { + wp_enqueue_style( 'jquery-swiper', OPALESTATE_PLUGIN_URL . '/assets/3rd/swiper/css/swiper.min.css' ); + } + wp_enqueue_script( 'jquery-swiper' ); } diff --git a/inc/email/class-opalesate-approve.php b/inc/email/class-opalesate-approve.php index 00d73846..0f5f8441 100755 --- a/inc/email/class-opalesate-approve.php +++ b/inc/email/class-opalesate-approve.php @@ -28,7 +28,11 @@ class OpalEstate_Send_Email_Approve extends OpalEstate_Abstract_Email_Template { */ public function get_subject () { $propety_title = '' ; - return sprintf( esc_html__( 'New Property Listing Submitted: {property_name}', 'opalestate-pro' ), $propety_title ); + + $subject = sprintf( esc_html__( 'The Property Listing Approved: {property_name}', 'opalestate-pro' ), $propety_title ); + $subject = opalestate_options( 'approve_email_body' , $subject ); + + return $subject; } /** @@ -58,7 +62,9 @@ class OpalEstate_Send_Email_Approve extends OpalEstate_Abstract_Email_Template { * */ public function get_content_template() { - return opalestate_load_template_path( 'emails/request-reviewing' ); + + $content = opalestate_options( 'approve_email_body' , self::get_default_template() ); + return $content; } /** diff --git a/inc/email/class-opalestate-email-notifycation.php b/inc/email/class-opalestate-email-notifycation.php index 220a7d7d..b28eb837 100755 --- a/inc/email/class-opalestate-email-notifycation.php +++ b/inc/email/class-opalestate-email-notifycation.php @@ -31,11 +31,17 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ public function get_subject () { switch ( $this->type ) { case 'enquiry': + $subject = html_entity_decode( esc_html__('You got a message enquiry', 'opalestate-pro') ); + $subject = opalestate_options( 'enquiry_email_subject', $subject ); + break; default: + $subject = html_entity_decode( esc_html__('You got a message contact', 'opalestate-pro') ); + $subject = opalestate_options( 'contact_email_subject', $subject ); + break; } @@ -46,14 +52,12 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ * Send Email */ public function get_content_template() { - switch ( $this->type ) { case 'enquiry': - return opalestate_load_template_path( 'emails/enquiry' ); + return opalestate_options( 'enquiry_email_body', self::get_default_template( 'enquiry' ) ); break; - default: - return opalestate_load_template_path( 'emails/contact' ); + return opalestate_options( 'contact_email_body', self::get_default_template( ) ); break; } } @@ -70,5 +74,15 @@ class OpalEstate_Send_Email_Notification extends OpalEstate_Abstract_Email_Templ $this->args['email'] = $this->args['receiver_email']; return parent::get_body(); } + + /***/ + public static function get_default_template ( $type='contact' ) { + + if( $type == 'enquiry' ) { + return opalestate_load_template_path( 'emails/enquiry' ); + } + + return opalestate_load_template_path( 'emails/contact' ); + } } ?> \ No newline at end of file diff --git a/inc/email/class-opalestate-new-submitted.php b/inc/email/class-opalestate-new-submitted.php index 76cf91b6..efa4bfc4 100755 --- a/inc/email/class-opalestate-new-submitted.php +++ b/inc/email/class-opalestate-new-submitted.php @@ -62,8 +62,7 @@ class OpalEstate_Send_Email_New_Submitted extends OpalEstate_Abstract_Email_Temp */ public function get_content_template() { - $body = opalestate_get_option( 'newproperty_email_body', self::newproperty_email_body() ); - + $body = opalestate_get_option( 'newproperty_email_body', self::get_default_template() ); return $body; } @@ -103,7 +102,6 @@ class OpalEstate_Send_Email_New_Submitted extends OpalEstate_Abstract_Email_Temp * Send Email */ public function get_body() { - return parent::get_body(); } } diff --git a/inc/email/class-opalestate-request-viewing.php b/inc/email/class-opalestate-request-viewing.php index 99ee9356..8eda4242 100755 --- a/inc/email/class-opalestate-request-viewing.php +++ b/inc/email/class-opalestate-request-viewing.php @@ -29,14 +29,18 @@ class OpalEstate_Send_Email_Request_Reviewing extends OpalEstate_Abstract_Email_ public function get_subject() { $propety_title = ''; - return sprintf( esc_html__( 'You have a message request reviewing: %s at', 'opalestate-pro' ), $propety_title ); + $content = sprintf( esc_html__( 'You have a message request reviewing: %s at', 'opalestate-pro' ), $propety_title ); + $content = opalestate_options( 'request_review_email_subject', $content ); + + return $content; } /** * Send Email */ public function get_content_template() { - return opalestate_load_template_path( 'emails/request-reviewing' ); + $content = opalestate_options( 'request_review_email_body', self::get_default_template() ); + return $content; } /** @@ -65,4 +69,9 @@ class OpalEstate_Send_Email_Request_Reviewing extends OpalEstate_Abstract_Email_ return parent::get_body(); } + + public static function get_default_template() { + return opalestate_load_template_path( 'emails/request-reviewing' ); + } + } diff --git a/opal-estate-pro.php b/opal-estate-pro.php index f373bd10..5c5935e2 100755 --- a/opal-estate-pro.php +++ b/opal-estate-pro.php @@ -3,7 +3,7 @@ * Plugin Name: Opal Estate Pro * Plugin URI: http://www.wpopal.com/product/opal-estate-wordpress-plugin/ * Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website. - * Version: 1.0.7 + * Version: 1.0.8 * Author: WPOPAL * Author URI: http://www.wpopal.com * Requires at least: 4.6 diff --git a/readme.txt b/readme.txt index 6232f73e..cfe1b184 100755 --- a/readme.txt +++ b/readme.txt @@ -99,6 +99,9 @@ The plugin will not make you disappointed with ease of use, friendly & flexible - [opalestate_search_agents] => Dislay Search box and agents collection + - [opalestate_agent_carousel] => Display List of Agent in carousel style + - [opalestate_agency_carousel] => Display List of Agency in carousel style + = Elementor Widgets = * Search: Property Form diff --git a/templates/elementor-templates/opalestate-agent-collection.php b/templates/elementor-templates/opalestate-agent-collection.php index 4453299e..4ff77659 100755 --- a/templates/elementor-templates/opalestate-agent-collection.php +++ b/templates/elementor-templates/opalestate-agent-collection.php @@ -39,7 +39,7 @@
have_posts() ): ?> -
+
> have_posts() ): $query->the_post(); ?>
diff --git a/templates/rating/opalestate-ratings.php b/templates/rating/opalestate-ratings.php index a0468f6c..44c2b5f7 100755 --- a/templates/rating/opalestate-ratings.php +++ b/templates/rating/opalestate-ratings.php @@ -36,6 +36,9 @@ switch ( $supports[ $post_type ]['post_type'] ) { break; } +if( !is_object($object) ) { + return; +} $cpt_feature = $supports[ $post_type ]['features_cpt']; $features = Opalestate_Rating_Helper::get_features( $cpt_feature ); diff --git a/templates/shortcodes/agency-carousel.php b/templates/shortcodes/agency-carousel.php new file mode 100644 index 00000000..86ae6ab5 --- /dev/null +++ b/templates/shortcodes/agency-carousel.php @@ -0,0 +1,37 @@ +$limit, 'paged' => $paged), $onlyfeatured ); +$item = $column; +$data = [ + 'slidesPerView' => $item, + 'spaceBetween' => 30, + 'slidesPerGroup' => $item, + 'loop' => false, +]; + +?> + + \ No newline at end of file diff --git a/templates/shortcodes/agent-carousel.php b/templates/shortcodes/agent-carousel.php new file mode 100644 index 00000000..d6b8a50e --- /dev/null +++ b/templates/shortcodes/agent-carousel.php @@ -0,0 +1,37 @@ +$limit, 'paged' => $paged), $onlyfeatured ); +$item = $column; +$data = [ + 'slidesPerView' => $item, + 'spaceBetween' => 30, + 'slidesPerGroup' => $item, + 'loop' => false, +]; + +?> + + \ No newline at end of file