2019-09-10 06:27:33 +02:00
|
|
|
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit;
|
|
|
|
}
|
2019-09-25 08:44:59 +02:00
|
|
|
|
2019-09-10 06:27:33 +02:00
|
|
|
global $post, $property;
|
|
|
|
|
2019-09-28 11:39:55 +02:00
|
|
|
|
|
|
|
if ( opalestate_get_option( 'enable_single_author_box' , 'on') != 'on' ) {
|
2019-09-25 08:44:59 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-09-25 09:01:07 +02:00
|
|
|
$type = $property->get_author_type();
|
|
|
|
$data = get_userdata( $post->post_author );
|
2019-09-10 06:27:33 +02:00
|
|
|
$layout = '';
|
|
|
|
switch ( $type ) {
|
2019-09-25 09:01:07 +02:00
|
|
|
case 'hide':
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
case 'agent' :
|
|
|
|
$agent_id = $property->get_metabox_value( 'agent' );
|
|
|
|
|
|
|
|
$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,
|
|
|
|
] );
|
|
|
|
break;
|
|
|
|
case 'agency' :
|
|
|
|
$agency_id = $property->get_metabox_value( 'agency' );
|
|
|
|
$author_info = opalestate_load_template_path( 'single-property/user/author-member-box', [
|
|
|
|
'author' => $data,
|
|
|
|
'id' => $agency_id,
|
|
|
|
'picture' => '',
|
|
|
|
'type' => 'agency',
|
|
|
|
'hide_description' => true,
|
|
|
|
] );
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$author_info = opalestate_load_template_path( 'single-property/user/author-user-box', [
|
|
|
|
'author' => $data,
|
|
|
|
'hide_description' => true,
|
|
|
|
],
|
|
|
|
$layout
|
|
|
|
);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2019-09-10 06:27:33 +02:00
|
|
|
?>
|
|
|
|
<div class="opalestate-box-content property-agent-section">
|
2019-09-25 09:01:07 +02:00
|
|
|
<div class="opalestate-box">
|
|
|
|
<div class="author-content-box">
|
|
|
|
<div class="property-agent-info">
|
2019-09-10 06:27:33 +02:00
|
|
|
<?php echo wp_kses_post( $author_info ); ?>
|
2019-09-25 09:01:07 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-10 06:27:33 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|