Opal-Estate-Pro/templates/single-property/author-v3.php

71 lines
2.3 KiB
PHP
Raw Normal View History

2019-09-10 06:27:33 +02:00
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $post, $property;
2019-09-25 08:44:59 +02:00
$type = $property->get_author_type();
$data = get_userdata( $post->post_author );
2019-09-10 06:27:33 +02:00
$layout = 'list';
switch ( $type ) {
2019-09-25 08:44:59 +02:00
case 'hide':
return;
break;
case 'agent' :
$agent_id = $property->get_metabox_value( 'agent' );
2019-09-25 09:01:07 +02:00
$author_info = opalestate_load_template_path( 'single-property/user/author-member-box', [
'author' => $data,
'id' => $agent_id,
'prefix' => OPALESTATE_AGENT_PREFIX,
'picture' => '',
'type' => 'agent',
'hide_description' => true,
] );
2019-09-25 08:44:59 +02:00
break;
case 'agency' :
$agency_id = $property->get_metabox_value( 'agency' );
2019-09-25 09:01:07 +02:00
$author_info = opalestate_load_template_path( 'single-property/user/author-member-box', [
'author' => $data,
'id' => $agency_id,
'picture' => '',
'type' => 'agency',
'hide_description' => true,
] );
2019-09-25 08:44:59 +02:00
break;
default:
2019-09-25 09:01:07 +02:00
$author_info = opalestate_load_template_path( 'single-property/user/author-user-box', [
'author' => $data,
'hide_description' => true,
],
$layout
);
2019-09-25 08:44:59 +02:00
break;
}
2019-09-10 06:27:33 +02:00
?>
2019-10-01 07:16:57 +02:00
<div class="opalestate-box-content property-agent-section property-author-v3">
2019-09-25 08:44:59 +02:00
<div class="opalestate-box">
<?php if ( opalestate_get_option( 'enable_single_author_box', 'on' ) == 'on' ) : ?>
<?php if ( opalestate_is_require_login_to_show_author_box() ) : ?>
<div class="author-content-box">
<div class="property-agent-info">
<?php echo wp_kses_post( $author_info ); ?>
</div>
2019-09-25 08:44:59 +02:00
</div>
<?php else : ?>
<div class="opalestate-require-login-box">
<p class="opalestate-require-login-notice"><?php esc_html_e( 'You need to login to see host information.', 'opalestate-pro' ); ?></p>
<a href="#opalestate-user-form-popup" class="opalestate-need-login button btn btn-primary btn-3d">
<?php esc_html_e( 'Login', 'opalestate-pro' ) ?>
</a>
</div>
<?php endif; ?>
2019-09-25 08:44:59 +02:00
<?php endif; ?>
2019-09-28 11:39:55 +02:00
<?php if ( opalestate_get_option( 'enable_single_enquire_form', 'on' ) == 'on' ) : ?>
2019-09-25 08:44:59 +02:00
<?php echo opalestate_load_template_path( 'messages/enquiry-form', [ 'nowrap' => true ] ); ?>
<?php endif; ?>
</div>
2019-09-10 06:27:33 +02:00
</div>