PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.66
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.66
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 1.0.22 All 173 releases
userswp / templates / bootstrap / user-avatar.php

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

58 lines 2.1 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 $allow_change = $args['allow_change'];
10 $avatar_url = $args['avatar_url'];
11 $user_id = $args['user_id'];
12 $link = $args['link'];
13 $size = isset($args['size']) ? $args['size'] : 50;
14
15 if($user_id){
16 $user = get_userdata($user_id);
17 } else {
18 $user = uwp_get_displayed_user();
19 }
20
21 if ( ! $user ) {
22 return;
23 }
24
25 if(!$uwp_in_user_loop){ ?><div class="card shadow-0 border-0 mw-100 bg-transparent"><?php } ?>
26
27 <div class="card-body <?php if(!$uwp_in_user_loop){ ?>mt-xl-0 pt-0<?php }else{?>text-center pb-0<?php }?>">
28
29 <div class="row justify-content-center">
30
31 <div class="col <?php if($uwp_in_user_loop){?>col-5<?php }?> text-center tofront ">
32 <?php if ($uwp_in_user_loop || 1==$link) { echo '<a href="'.esc_url(get_author_posts_url($user->ID)).'" title="'.esc_attr( $user->display_name ).'">';} ?>
33 <?php $avatar_args = array('class' => 'rounded-circle shadow border border-white border-width-4 p-0 mw-100', "width" => $size);
34 echo get_avatar($user_id,$size,esc_url( $avatar_url ),'User avatar',$avatar_args); ?>
35 <?php if ($uwp_in_user_loop || 1==$link) {echo '</a>';} ?>
36 <?php do_action('uwp_after_user_avatar',$user->ID); ?>
37 <?php if (!$uwp_in_user_loop && is_user_logged_in() && ( get_current_user_id() == $user->ID ) && $allow_change ) { ?>
38 <div class="card-img-overlay d-flex p-0">
39 <?php
40 echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
41 'type' => 'a',
42 'href' => '#',
43 'class' => 'btn btn-sm uwp-banner-change-icon btn-outline-secondary btn-circle border-0 align-self-end mx-auto',
44 'icon' => 'fas fa-camera fa-fw',
45 'onclick' => "uwp_profile_image_change('avatar');return false;",
46 'extra_attributes' => array('data-toggle'=>'tooltip', 'data-original-title'=>esc_html__( 'Update Profile Image', 'userswp' ))
47 ));
48 ?>
49 </div>
50 <?php } ?>
51 </div>
52
53 </div>
54
55 </div>
56
57 <?php if(!$uwp_in_user_loop){ ?></div><?php } ?>
58