-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-orbis_person.php
More file actions
executable file
·261 lines (181 loc) · 7.28 KB
/
single-orbis_person.php
File metadata and controls
executable file
·261 lines (181 loc) · 7.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<?php get_header(); ?>
<?php
while ( have_posts() ) :
the_post();
?>
<div class="row">
<div class="col-md-8">
<div class="card with-cols clearfix mb-3">
<div class="card-header"><?php esc_html_e( 'About this contact', 'orbis-5' ); ?></div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="content">
<?php if ( has_post_thumbnail() ) : ?>
<div class="thumbnail">
<?php the_post_thumbnail( 'thumbnail' ); ?>
</div>
<?php endif; ?>
<?php the_content(); ?>
</div>
</div>
<div class="col-md-6">
<div class="content">
<?php $contact = new Orbis_Contact(); ?>
<dl>
<?php
$data = array_filter(
[
$contact->get_title(),
$contact->get_organization(),
$contact->get_department(),
]
);
if ( ! empty( $data ) ) :
?>
<dt><?php esc_html_e( 'Company', 'orbis-5' ); ?></dt>
<dd>
<?php echo esc_html( implode( ', ', $data ) ); ?>
</dd>
<?php endif; ?>
<?php if ( get_post_meta( $post->ID, '_orbis_phone_number', true ) ) : ?>
<dt><?php esc_html_e( 'Phone number', 'orbis-5' ); ?></dt>
<dd><a href="tel:<?php echo esc_attr( get_post_meta( $post->ID, '_orbis_phone_number', true ) ); ?>" class="anchor-tooltip" title="<?php esc_attr_e( 'Call this number', 'orbis-5' ); ?>"><?php echo esc_html( get_post_meta( $post->ID, '_orbis_phone_number', true ) ); ?></a></dd>
<?php endif; ?>
<?php if ( get_post_meta( $post->ID, '_orbis_mobile_number', true ) ) : ?>
<dt><?php esc_html_e( 'Mobile number', 'orbis-5' ); ?></dt>
<dd><a href="tel:<?php echo esc_attr( get_post_meta( $post->ID, '_orbis_mobile_number', true ) ); ?>" class="anchor-tooltip" title="<?php esc_attr_e( 'Call this number', 'orbis-5' ); ?>"><?php echo esc_html( get_post_meta( $post->ID, '_orbis_mobile_number', true ) ); ?></a></dd>
<?php endif; ?>
<?php
$email = $contact->get_email();
if ( ! empty( $email ) ) :
?>
<dt><?php esc_html_e( 'E-mail address', 'orbis-5' ); ?></dt>
<dd>
<a href="mailto:<?php echo esc_attr( $email ); ?>"><?php echo esc_html( $email ); ?></a>
</dd>
<?php endif; ?>
<?php
$gender = $contact->get_gender();
if ( ! empty( $gender ) ) :
?>
<dt><?php esc_html_e( 'Gender', 'orbis-5' ); ?></dt>
<dd>
<?php echo esc_html( $gender->name ); ?>
</dd>
<?php endif; ?>
<?php
$address = (string) $contact->get_address();
if ( ! empty( $address ) ) :
?>
<dt><?php esc_html_e( 'Address', 'orbis-5' ); ?></dt>
<dd>
<?php echo nl2br( esc_html( $address ) ); ?>
</dd>
<?php endif; ?>
<?php
$iban = get_post_meta( $post->ID, '_orbis_iban', true );
if ( ! empty( $iban ) ) :
?>
<dt><?php esc_html_e( 'IBAN Number', 'orbis-5' ); ?></dt>
<dd>
<?php echo esc_attr( get_post_meta( $post->ID, '_orbis_iban', true ) ); ?>
</dd>
<?php endif; ?>
<?php
$birth_date = $contact->get_birth_date();
if ( $birth_date ) :
?>
<dt><?php esc_html_e( 'Birth Date', 'orbis-5' ); ?></dt>
<dd>
<?php echo esc_html( date_i18n( __( 'j F Y', 'orbis-5' ), $birth_date->getTimestamp() ) ); ?>
</dd>
<dt><?php esc_html_e( 'Age', 'orbis-5' ); ?></dt>
<dd>
<?php echo esc_html( $contact->get_age() ); ?>
</dd>
<?php endif; ?>
<?php if ( has_term( null, 'orbis_person_category' ) ) : ?>
<dt><?php esc_html_e( 'Categories', 'orbis-5' ); ?></dt>
<dd>
<?php the_terms( get_the_ID(), 'orbis_person_category' ); ?>
</dd>
<?php endif; ?>
<dt><?php esc_html_e( 'vCard', 'orbis-5' ); ?></dt>
<dd>
<?php
printf(
'<a href="%s">%s</a>',
esc_attr( get_permalink() . 'vcard/' ),
esc_html__( 'Download vCard', 'orbis-5' )
);
?>
</dd>
<?php if ( get_post_meta( $post->ID, '_orbis_twitter', true ) || get_post_meta( $post->ID, '_orbis_facebook', true ) || get_post_meta( $post->ID, '_orbis_linkedin', true ) ) : ?>
<dt><?php esc_html_e( 'Social media', 'orbis-5' ); ?></dt>
<dd>
<ul class="social clearfix">
<?php if ( get_post_meta( $post->ID, '_orbis_twitter', true ) ) : ?>
<li class="twitter">
<?php $twitter_url = 'https://twitter.com/' . get_post_meta( $post->ID, '_orbis_twitter', true ); ?>
<a href="<?php echo esc_attr( $twitter_url ); ?>">
<i class="fab fa-twitter"></i>
<span class="sr-only"><?php esc_html_e( 'Twitter', 'orbis-5' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( get_post_meta( $post->ID, '_orbis_facebook', true ) ) : ?>
<li class="facebook">
<?php $facebook_url = get_post_meta( $post->ID, '_orbis_facebook', true ); ?>
<a href="<?php echo esc_attr( $facebook_url ); ?>">
<i class="fab fa-facebook"></i>
<span class="sr-only"><?php esc_html_e( 'Facebook', 'orbis-5' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( get_post_meta( $post->ID, '_orbis_linkedin', true ) ) : ?>
<li class="linkedin">
<?php $linkedin_url = get_post_meta( $post->ID, '_orbis_linkedin', true ); ?>
<a href="<?php echo esc_attr( $linkedin_url ); ?>">
<i class="fab fa-linkedin"></i>
<span class="sr-only"><?php esc_html_e( 'LinkedIn', 'orbis-5' ); ?></span>
</a>
</li>
<?php endif; ?>
</ul>
</dd>
<?php endif; ?>
</dl>
</div>
</div>
</div>
<?php get_template_part( 'templates/post-card-footer' ); ?>
</div>
</div>
<?php comments_template( '', true ); ?>
</div>
<div class="col-md-4">
<?php get_template_part( 'templates/person_twitter' ); ?>
<?php if ( function_exists( 'p2p_register_connection_type' ) ) : ?>
<?php get_template_part( 'templates/person_companies' ); ?>
<?php endif; ?>
<div class="card mb-3">
<div class="card-header"><?php esc_html_e( 'Additional information', 'orbis-5' ); ?></div>
<div class="card-body">
<dl>
<dt><?php esc_html_e( 'Posted on', 'orbis-5' ); ?></dt>
<dd><?php echo esc_html( get_the_date() ); ?></dd>
<dt><?php esc_html_e( 'Posted by', 'orbis-5' ); ?></dt>
<dd><?php echo esc_html( get_the_author() ); ?></dd>
<?php if ( null !== get_edit_post_link() ) : ?>
<dt><?php esc_html_e( 'Actions', 'orbis-5' ); ?></dt>
<dd><?php edit_post_link( __( 'Edit', 'orbis-5' ) ); ?></dd>
<?php endif; ?>
</dl>
</div>
</div>
<?php do_action( 'orbis_after_side_content' ); ?>
</div>
</div>
<?php endwhile; ?>
<?php get_footer(); ?>