profile.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. global $error,$post;
  3. $booked_current_user = wp_get_current_user();
  4. $profile_username = $booked_current_user->user_login;
  5. $my_id = $booked_current_user->ID;
  6. $my_profile = true;
  7. $user_data = get_user_by( 'id', $booked_current_user->ID );
  8. ?><div id="booked-profile-page"<?php if ($my_profile): ?> class="me"<?php endif; ?>><?php
  9. if (empty($user_data)) {
  10. echo '<h2>' . esc_html__('No profile here!','booked') . '</h2>';
  11. echo '<p>' . esc_html__('Sorry, this user profile does not exist.','booked') . '</p>';
  12. } else { ?>
  13. <?php
  14. $user_meta = get_user_meta($user_data->ID);
  15. $user_url = $user_data->data->user_url;
  16. $user_desc = $user_meta['description'][0];
  17. $h3_class = '';
  18. ?>
  19. <div class="booked-profile-header bookedClearFix">
  20. <div class="booked-info">
  21. <div class="booked-user">
  22. <div class="booked-user-avatar"><?php echo booked_avatar($user_data->ID,50); ?></div>
  23. <h3 class="<?php echo $h3_class; ?>">
  24. <?php echo sprintf(esc_html__('Welcome back, %s!','booked'),'<strong>'.booked_get_name( $user_data->ID ).'</strong>'); ?>
  25. <?php if ($my_profile): ?>
  26. &nbsp;&nbsp;<a class="booked-logout-button" href="<?php echo wp_logout_url(get_permalink($post->ID)); ?>" title="<?php esc_html_e('Sign Out','booked'); ?>"><?php esc_html_e('Sign Out','booked'); ?></a>
  27. <?php endif; ?>
  28. </h3>
  29. </div>
  30. </div>
  31. </div>
  32. <ul class="booked-tabs bookedClearFix">
  33. <?php
  34. $default_tabs = array(
  35. 'appointments' => array(
  36. 'title' => esc_html__('Upcoming Appointments','booked'),
  37. 'booked-icon' => 'booked-calendar',
  38. 'class' => false
  39. ),
  40. 'history' => array(
  41. 'title' => esc_html__('Appointment History','booked'),
  42. 'booked-icon' => 'booked-calendar-check-o',
  43. 'class' => false
  44. ),
  45. 'edit' => array(
  46. 'title' => esc_html__('Edit Profile','booked'),
  47. 'booked-icon' => 'booked-edit',
  48. 'class' => 'edit-button'
  49. )
  50. );
  51. echo apply_filters( 'booked_profile_tabs', $default_tabs );
  52. ?>
  53. </ul>
  54. <?php $appointment_default_status = get_option('booked_new_appointment_default','draft');
  55. if ( is_user_logged_in() && $my_profile ) : ?>
  56. <?php echo apply_filters( 'booked_profile_tab_content',$default_tabs ); ?>
  57. <?php endif; ?>
  58. <?php } ?>
  59. </div>