| 1 |
<?php |
| 2 |
$user_id = get_current_user_id(); |
| 3 |
$user_info = get_userdata($user_id); |
| 4 |
$display_name = esc_attr( $user_info->data->display_name ); |
| 5 |
$profile_link = uwp_build_profile_tab_url($user_id); |
| 6 |
$hello_text = !empty($args['dashboard_text']) ? esc_attr__($args['dashboard_text'],'userswp') : __( 'Hello, %s', 'userswp' ); |
| 7 |
$display_name = "<a href='".esc_url($profile_link)."' >".esc_attr($display_name)."</a>"; |
| 8 |
$hello_text = sprintf($hello_text,$display_name); |
| 9 |
$dashboard_links = !empty($args['template_args']['dashboard_links']) ? $args['template_args']['dashboard_links'] : ''; |
| 10 |
?> |
| 11 |
<div class="card text-center border-0"> |
| 12 |
<a href="<?php echo esc_url( $profile_link );?>"> |
| 13 |
<img src="<?php echo esc_url( get_avatar_url( get_current_user_id(), array('size' => 100) ) ); ?>" class="rounded-circle shadow border border-white border-width-4" alt="<?php echo esc_attr($user_info->data->display_name);?>"> |
| 14 |
</a> |
| 15 |
<div class="card-body"> |
| 16 |
<?php do_action('uwp_template_form_title_before', 'dashboard'); ?> |
| 17 |
<h5 class="card-title"><?php echo apply_filters('uwp_template_form_title', $hello_text, 'dashboard'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h5> |
| 18 |
<?php do_action('uwp_template_form_title_after', 'dashboard'); ?> |
| 19 |
<?php do_action('uwp_template_display_notices', 'dashboard'); ?> |
| 20 |
|
| 21 |
<div class="uwp-dashboard-links"> |
| 22 |
<?php |
| 23 |
do_action('uwp_dashboard_links_before',$args); |
| 24 |
|
| 25 |
global $userswp; |
| 26 |
$userswp->forms->output_dashboard_links( $dashboard_links ); |
| 27 |
|
| 28 |
do_action('uwp_dashboard_links_after',$args); |
| 29 |
?> |
| 30 |
</div> |
| 31 |
|
| 32 |
<div class="uwp-logout-link pt-3"> |
| 33 |
<?php |
| 34 |
echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 35 |
'type' => 'a', |
| 36 |
'href' => esc_url( wp_logout_url() ), |
| 37 |
'class' => 'btn btn-sm btn-outline-primary', |
| 38 |
'content' => esc_html__( 'Logout', 'userswp' ), |
| 39 |
'extra_attributes' => array('rel'=>'nofollow') |
| 40 |
)); |
| 41 |
?> |
| 42 |
</div> |
| 43 |
</div> |
| 44 |
</div> |