-
Notifications
You must be signed in to change notification settings - Fork 9
/
sidebar-single-vendor.php
81 lines (66 loc) · 1.85 KB
/
sidebar-single-vendor.php
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
<?php
/**
* The Sidebar for the vendor page
*
* @since 1.0.0
*/
$vendor_id = absint( fes_get_vendor()->ID );
$user_data = get_userdata( $vendor_id );
$author_options = themedd_edd_download_author_options();
?>
<div id="secondary" class="<?php echo themedd_secondary_classes(); ?>">
<div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary">
<?php do_action( 'themedd_edd_fes_sidebar_single_vendor_start' ); ?>
<?php
/**
* The vendor profile and contact form (if enabled)
*/
?>
<section class="widget downloadAuthor">
<?php
/**
* Vendor's avatar.
*/
?>
<div class="downloadAuthor-avatar">
<?php echo get_avatar( $vendor_id, $author_options['avatar_size'], '', $user_data->display_name ); ?>
</div>
<?php
/**
* Vendor's name.
*/
$user_info = get_userdata( $vendor_id );
$display_name = $user_info->display_name;
?>
<h2 class="widget-title"><?php echo $display_name; ?></h2>
<?php
/**
* Vendor's description.
*/
$description = get_the_author_meta( 'description', $vendor_id );
if ( $description ) : ?>
<div class="downloadAuthor-description">
<p><?php echo $description; ?></p>
</div>
<?php endif; ?>
<?php
/**
* Vendor's website.
*/
$website = get_the_author_meta( 'user_url', $vendor_id );
if ( $website ) : ?>
<div class="downloadAuthor-website">
<p><a href="<?php echo esc_url( $website ); ?>" target="_blank" rel="noopener"><?php _e( 'Visit website', 'themedd' ); ?></a></p>
</div>
<?php endif; ?>
<?php
/**
* Vendor's contact form.
*/
if ( themedd_edd_fes_vendor_contact_form() ) : ?>
<?php echo (new FES_Forms)->render_vendor_contact_form( $vendor_id ); ?>
<?php endif; ?>
</section>
<?php do_action( 'themedd_edd_fes_sidebar_single_vendor_end' ); ?>
</div>
</div>