| 1 |
<?php do_action('uwp_template_before', 'dashboard'); |
| 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="uwp-content-wrap"> |
| 12 |
<div class="uwp-account" <?php if(!empty($args['form_padding'])){echo "style='padding:".absint($args['form_padding'])."px'";}?>> |
| 13 |
<div class="uwp-account-avatar"><a href="<?php echo esc_url( $profile_link );?>"><?php echo get_avatar( get_current_user_id(), 100 ); ?></a></div> |
| 14 |
<?php do_action('uwp_template_form_title_before', 'dashboard'); ?> |
| 15 |
<h2><?php |
| 16 |
echo apply_filters('uwp_template_form_title', esc_attr( $hello_text ), 'dashboard'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 17 |
?></h2> |
| 18 |
<?php do_action('uwp_template_form_title_after', 'dashboard'); ?> |
| 19 |
<?php do_action('uwp_template_display_notices', 'dashboard'); ?> |
| 20 |
<div class="uwp-dashboard-links"> |
| 21 |
<?php |
| 22 |
do_action('uwp_dashboard_links_before',$args); |
| 23 |
|
| 24 |
global $userswp; |
| 25 |
$userswp->forms->output_dashboard_links( $dashboard_links ); |
| 26 |
|
| 27 |
do_action('uwp_dashboard_links_after',$args); |
| 28 |
?> |
| 29 |
</div> |
| 30 |
<div class="uwp-login-links"> |
| 31 |
<div class="uwp-logout-link"> |
| 32 |
<a href="<?php echo esc_url( wp_logout_url() );?>"><?php esc_html_e("Logout","userswp");?></a> |
| 33 |
</div> |
| 34 |
</div> |
| 35 |
|
| 36 |
</div> |
| 37 |
</div> |
| 38 |
<?php do_action('uwp_template_after', 'dashboard'); ?> |