Add hooks.

This commit is contained in:
Hoang Huu 2019-11-08 08:41:22 +07:00
parent e387d976de
commit b244e8de6b
6 changed files with 43 additions and 25 deletions

View File

@ -14,7 +14,6 @@ function opalestate_single_property_layout_default() {
add_action( 'opalestate_single_property_summary', 'opalestate_property_facilities', 17 );
add_action( 'opalestate_single_property_summary', 'opalestate_property_attachments', 18 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_video', 20 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_virtual_tour', 25 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_map', 30 );
@ -25,7 +24,6 @@ function opalestate_single_property_layout_default() {
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_apartments', 45 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_floor_plans', 45 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_views_statistics', 50 );
// add_action( 'opalestate_after_single_property_summary', '', 55 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 );
if ( opalestate_property_reviews_enabled() ) {
@ -34,12 +32,9 @@ function opalestate_single_property_layout_default() {
add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 );
////// sidebar ////////
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_author_v2', 5 );
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_equiry_form', 6 );
// add_action( 'opalestate_single_property_sidebar', 'opalestate_property_request_viewing_button', 7 );
if ( opalestate_get_option( 'enable_single_mortgage', 'on' ) == 'on' ) {
add_action( 'opalestate_single_property_sidebar', 'opalestate_property_mortgage', 9 );
}
@ -57,11 +52,6 @@ function opalestate_single_property_layout_default() {
function opalestate_single_property_layout_v2() {
add_action( 'opalestate_single_property_summary', 'opalestate_get_single_short_meta', 10 );
add_action( 'opalestate_single_property_summary', 'opalestate_property_content', 12 );
//add_action( 'opalestate_single_property_summary', 'opalestate_property_information', 15 );
//add_action( 'opalestate_single_property_summary', 'opalestate_property_amenities', 16 );
//add_action( 'opalestate_single_property_summary', 'opalestate_property_facilities', 17 );
//add_action( 'opalestate_single_property_summary', 'opalestate_property_attachments', 18 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_video', 20 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_virtual_tour', 25 );
@ -71,8 +61,6 @@ function opalestate_single_property_layout_v2() {
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_apartments', 45 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_views_statistics', 50 );
// add_action( 'opalestate_after_single_property_summary', 'opalestate_property_author', 55 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 );
if ( opalestate_property_reviews_enabled() ) {
@ -81,14 +69,11 @@ function opalestate_single_property_layout_v2() {
add_action( 'opalestate_after_single_property_summary_v2', 'opalestate_property_map_v2', 5 );
/// /// sidebar ////////
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 );
// add_action( 'opalestate_single_property_sidebar', 'opalestate_property_equiry_form' , 12 );
}
@ -103,17 +88,14 @@ function opalestate_single_property_layout_v3() {
add_action( 'opalestate_single_property_summary', 'opalestate_property_facilities', 17 );
add_action( 'opalestate_single_property_summary', 'opalestate_property_attachments', 18 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_video', 20 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_virtual_tour', 25 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_map', 30 );
// add_action( 'opalestate_after_single_property_summary', 'opalestate_property_nearby', 35 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_walkscore', 40 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_apartments', 45 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_views_statistics', 50 );
// add_action( 'opalestate_after_single_property_summary', 'opalestate_property_author', 55 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_tags', 60 );
if ( opalestate_property_reviews_enabled() ) {
@ -177,7 +159,6 @@ function opalestate_single_property_layout_v5() {
add_action( 'opalestate_single_property_summary', 'opalestate_property_facilities', 17 );
add_action( 'opalestate_single_property_summary', 'opalestate_property_attachments', 18 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_video', 20 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_virtual_tour', 25 );
add_action( 'opalestate_after_single_property_summary', 'opalestate_property_map', 30 );
@ -209,14 +190,10 @@ function opalestate_single_property_layout_v5() {
}
}
///
add_action( 'opalestate_single_property_after_render', 'opalestate_properties_related', 5 );
add_action( 'opalestate_single_property_after_render', 'opalestate_properties_nearby', 6 );
add_action( 'opalestate_single_property_preview', 'opalestate_property_preview', 15 );
function opalestate_property_request_viewing_button( $islink = false ) {
if ( 'on' != opalestate_get_option( 'enable_single_request_viewing', 'on' ) ) {
return;
@ -236,7 +213,9 @@ function opalestate_property_request_viewing_button( $islink = false ) {
}
/**
* @param $layout
* Get single layout.
*
* @param string $layout Layout.
*/
function opalestate_single_property_layout( $layout ) {
switch ( $layout ) {
@ -334,7 +313,6 @@ function opalestate_load_plugin_template( $template ) {
} else {
$template = OPALESTATE_PLUGIN_DIR . '/templates/fullwidth-page.php';
}
}
if ( $template == '' ) {

View File

@ -14,10 +14,14 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<header class="property-single-header">
<div class="property-single-info">
<div class="group-items">
<?php do_action( 'opalestate_before_single_property_title' ); ?>
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php opalestate_property_label(); ?>
<?php opalestate_property_status(); ?>
<?php do_action( 'opalestate_after_single_property_title' ); ?>
<div class="property-meta">
<div class="property-meta__list">
<?php opalestate_property_types_list(); ?>
@ -88,6 +92,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<div class="property-tab-content">
<div class="property-meta-top">
<ul class="list-inline property-meta-top__list">
<?php do_action( 'opalestate_before_property_meta_top_list' ); ?>
<?php if ( $property->get_sku() ) : ?>
<li class="list-inline__sku">
<span><?php esc_html_e( 'Property ID: ', 'opalestate-pro' ) ?></span>
@ -103,6 +109,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<li class="list-inline__favorite property-meta-top__button">
<?php echo do_shortcode( '[opalestate_favorite_button property_id=' . get_the_ID() . ']' ); ?>
</li>
<?php do_action( 'opalestate_after_property_meta_top_list' ); ?>
</ul>
</div>

View File

@ -13,6 +13,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<div class="property-single-stick-bars keep-top-bars ">
<div class="container">
<ul class="list-inline">
<?php do_action( 'opalestate_before_property_meta_top_list' ); ?>
<li class="list-inline__favorite">
<?php echo do_shortcode( '[opalestate_favorite_button property_id=' . get_the_ID() . ']' ); ?>
</li>
@ -24,6 +26,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<li class="list-inline__request-viewing single-property-buttons">
<?php opalestate_property_request_viewing_button(); ?>
</li>
<?php do_action( 'opalestate_after_property_meta_top_list' ); ?>
</ul>
</div>
</div>
@ -38,10 +42,14 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<div class="property-single-info">
<div class="single-price-content"><?php opalestate_property_loop_price(); ?></div>
<div class="group-items">
<?php do_action( 'opalestate_before_single_property_title' ); ?>
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php opalestate_property_label(); ?>
<?php opalestate_property_status(); ?>
<?php do_action( 'opalestate_after_single_property_title' ); ?>
<div class="property-meta">
<div class="property-meta__list">
<?php opalestate_property_types_list(); ?>

View File

@ -11,10 +11,14 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<header class="property-single-header">
<div class="property-single-info">
<div class="group-items">
<?php do_action( 'opalestate_before_single_property_title' ); ?>
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php opalestate_property_label(); ?>
<?php opalestate_property_status(); ?>
<?php do_action( 'opalestate_after_single_property_title' ); ?>
<div class="property-meta">
<div class="property-meta__list">
<?php opalestate_property_types_list(); ?>
@ -58,6 +62,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<div class="summary entry-summary opalestate-rows">
<div class="property-meta-top">
<ul class="list-inline property-meta-top__list">
<?php do_action( 'opalestate_before_property_meta_top_list' ); ?>
<?php if ( $property->get_sku() ) : ?>
<li class="list-inline__sku">
<span><?php esc_html_e( 'Property ID: ', 'opalestate-pro' ) ?></span>
@ -73,6 +79,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<li class="list-inline__favorite property-meta-top__button">
<?php echo do_shortcode( '[opalestate_favorite_button property_id=' . get_the_ID() . ']' ); ?>
</li>
<?php do_action( 'opalestate_after_property_meta_top_list' ); ?>
</ul>
</div>

View File

@ -51,10 +51,14 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<div class="property-single-info">
<div class="single-price-content"><?php opalestate_property_loop_price(); ?></div>
<div class="group-items">
<?php do_action( 'opalestate_before_single_property_title' ); ?>
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php opalestate_property_label(); ?>
<?php opalestate_property_status(); ?>
<?php do_action( 'opalestate_after_single_property_title' ); ?>
<div class="property-meta">
<div class="property-meta__list">
<?php opalestate_property_types_list(); ?>
@ -91,6 +95,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<div class="summary entry-summary opalestate-rows">
<div class="property-meta-top">
<ul class="list-inline property-meta-top__list">
<?php do_action( 'opalestate_before_property_meta_top_list' ); ?>
<?php if ( $property->get_sku() ) : ?>
<li class="list-inline__sku">
<span><?php esc_html_e( 'Property ID: ', 'opalestate-pro' ) ?></span>
@ -103,6 +109,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<li class="list-inline__favorite property-meta-top__button">
<?php echo do_shortcode( '[opalestate_favorite_button property_id=' . get_the_ID() . ']' ); ?>
</li>
<?php do_action( 'opalestate_after_property_meta_top_list' ); ?>
</ul>
</div>

View File

@ -9,10 +9,14 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<header class="property-single-header">
<div class="property-single-info">
<div class="group-items">
<?php do_action( 'opalestate_before_single_property_title' ); ?>
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php opalestate_property_label(); ?>
<?php opalestate_property_status(); ?>
<?php do_action( 'opalestate_after_single_property_title' ); ?>
<div class="property-meta">
<div class="property-meta__list">
<?php opalestate_property_types_list(); ?>
@ -63,6 +67,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<div class="summary entry-summary opalestate-rows">
<div class="property-meta-top">
<ul class="list-inline property-meta-top__list">
<?php do_action( 'opalestate_before_property_meta_top_list' ); ?>
<?php if ( $property->get_sku() ) : ?>
<li class="list-inline__sku">
<span><?php esc_html_e( 'Property ID: ', 'opalestate-pro' ) ?></span>
@ -78,6 +84,8 @@ $header = apply_filters( 'opalestate_single_show_heading', true );
<li class="list-inline__favorite property-meta-top__button">
<?php echo do_shortcode( '[opalestate_favorite_button property_id=' . get_the_ID() . ']' ); ?>
</li>
<?php do_action( 'opalestate_after_property_meta_top_list' ); ?>
</ul>
</div>