PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.69
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.69
1.2.74 1.2.73 1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 All 174 releases
userswp / templates / bootstrap / profile-header.php

profile-header.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.2.69, at templates/bootstrap/profile-header.php

141 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Profile header template (default)
4 *
5 * @ver 0.0.1
6 */
7 global $userswp, $uwp_in_user_loop;
8 $css_class = ! empty( $args['css_class'] ) ? esc_attr( $args['css_class'] ) : 'border-0';
9 $hide_cover = $args['hide_cover'];
10 $allow_change = $args['allow_change'];
11 $hide_avatar = $args['hide_avatar'];
12 $avatar_url = $args['avatar_url'];
13 $banner_url = $args['banner_url'];
14 $user_id = $args['user_id'];
15
16 if ( $user_id ) {
17 $user = get_userdata( $user_id );
18 } else {
19 $user = uwp_get_displayed_user();
20 }
21
22 if ( ! $user ) {
23 return;
24 }
25
26 if ( ! $uwp_in_user_loop ) {
27 do_action( 'uwp_template_display_notices', 'profile' );
28 ?>
29 <div class="card shadow-0 border-0 mw-100"><?php }
30
31 if ( ! $hide_cover ) {
32 if ( $uwp_in_user_loop ) {
33 echo '<a href="' . esc_url( uwp_build_profile_tab_url( $user->ID ) ) . '" title="' . esc_attr( $user->display_name ). '">';
34 } ?>
35 <img class="card-img-top m-0 p-0 uwp-banner-image" src="<?php echo esc_url( $banner_url ); ?>"
36 alt="<?php esc_attr_e( "User banner image", "userswp" ); ?>">
37 <?php if ( $uwp_in_user_loop ) {
38 echo '</a>';
39 } ?>
40
41 <?php if ( ! $uwp_in_user_loop && is_user_logged_in() && $allow_change && ( get_current_user_id() == $user->ID ) ) { ?>
42 <div class="card-img-overlay p-1 bg-shadow-bottom-dd">
43 <?php
44 echo aui()->button( array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
45 'type' => 'a',
46 'href' => '#',
47 'class' => 'btn btn-sm uwp-banner-change-icon btn-outline-secondary border-0',
48 'icon' => 'fas fa-camera fa-fw',
49 'title' => '',
50 'onclick' => "uwp_profile_image_change('banner');return false;",
51 'extra_attributes' => array( 'data-toggle' => 'tooltip', 'data-original-title' => esc_html__( 'Update Profile Image', 'userswp' )
52 )
53 ) );
54 ?>
55 </div>
56 <?php }
57
58 } ?>
59
60 <div class="card-body <?php if ( ! $uwp_in_user_loop ) { ?>mt-xl-0 pt-0<?php } else { ?>text-center pb-0<?php } ?>">
61
62 <div class="row justify-content-center">
63
64 <?php if ( ! $hide_avatar ) { ?>
65 <div class="col <?php if ( $uwp_in_user_loop ) { ?>col-5<?php } ?> text-center tofront ">
66 <?php if ( $uwp_in_user_loop ) {
67 echo '<a href="' . esc_url( uwp_build_profile_tab_url( $user->ID ) ) . '" title="' . esc_attr( $user->display_name ) . '">';
68 } ?>
69 <img class="rounded-circle shadow border border-white border-width-4 p-0 mw-100 <?php if ( ! $hide_cover ) {
70 echo "mt-neg5";
71 } ?>"
72 src="<?php echo esc_url( $avatar_url ); ?>" alt="<?php esc_html_e( "User avatar", "userswp" ); ?>">
73 <?php if ( $uwp_in_user_loop ) {
74 echo '</a>';
75 } ?>
76
77 <?php if ( ! $uwp_in_user_loop && is_user_logged_in() && ( get_current_user_id() == $user->ID ) && $allow_change ) { ?>
78 <div class="card-img-overlay p-0">
79 <?php
80 echo aui()->button( array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
81 'type' => 'a',
82 'href' => '#',
83 'class' => 'btn btn-sm uwp-banner-change-icon btn-outline-secondary btn-circle border-0 align-self-end mx-auto',
84 'icon' => 'fas fa-camera fa-fw',
85 'title' => '',
86 'onclick' => "uwp_profile_image_change('avatar');return false;",
87 'extra_attributes' => array( 'data-toggle' => 'tooltip', 'data-original-title' => esc_html__( 'Update Profile Image', 'userswp' )
88 )
89 ) );
90 ?>
91 </div>
92 <?php } ?>
93 </div>
94 <?php } ?>
95
96 <div class="col-12 <?php if ( ! $uwp_in_user_loop ) {
97 echo $hide_avatar ? "col-xl-8" : "col-xl-6"; ?> text-xl-left text-xl-start pt-xl-1<?php } ?> text-center ">
98 <ul class="list-group border-0 m-0 p-0 bg-transparent">
99 <li class="list-group-item border-0 m-0 p-0 bg-transparent uwp-profile-title">
100 <?php
101 // User title.
102 if ( $uwp_in_user_loop ) {
103 $userswp->profile->get_profile_title( $user, $tag = 'h4', 'h4 card-title text-dark font-weight-bold m-0 p-0', 'text-muted', true );
104 } else {
105 $userswp->profile->get_profile_title( $user, $tag = 'h2', 'h2 card-title text-dark font-weight-bold m-0 p-0', '', false );
106 }
107 ?>
108 </li>
109 </ul>
110 <?php echo do_shortcode( "[uwp_user_post_counts disable_greedy=".esc_attr($args['disable_greedy'])."]" ); ?>
111 </div>
112 <div class="col-12 <?php if ( ! $uwp_in_user_loop ) { ?>col-xl-4 text-xl-right <?php } ?> text-center pt-2">
113 <?php
114 echo do_shortcode( "[uwp_button_group]" );
115 ?>
116 </div>
117 </div>
118
119 <?php if ( ! $uwp_in_user_loop && is_uwp_profile_page() ) { ?>
120
121 <div class="row justify-content-center">
122 <div class="col">
123 </div>
124 <div class="col-12 <?php echo $hide_avatar ? "col-xl-8" : "col-xl-6"; ?> text-xl-start text-xl-end pt-xl-1">
125 <?php
126 echo do_shortcode( "[uwp_user_actions]" );
127 ?>
128 </div>
129 <div class="col-12 col-xl-4 text-xl-right text-right">
130 <?php
131 echo do_shortcode( "[uwp_profile_actions]" );
132 ?>
133 </div>
134 </div>
135
136 <?php } ?>
137
138 </div>
139
140 <?php if ( ! $uwp_in_user_loop ){ ?></div><?php } ?>
141