Nessuna descrizione

profile.php 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
  2. <div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( $form_id ); ?> um-role-<?php echo esc_attr( um_user( 'role' ) ); ?> ">
  3. <div class="um-form" data-mode="<?php echo esc_attr( $mode ) ?>">
  4. <?php
  5. /**
  6. * UM hook
  7. *
  8. * @type action
  9. * @title um_profile_before_header
  10. * @description Some actions before profile form header
  11. * @input_vars
  12. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  13. * @change_log
  14. * ["Since: 2.0"]
  15. * @usage add_action( 'um_profile_before_header', 'function_name', 10, 1 );
  16. * @example
  17. * <?php
  18. * add_action( 'um_profile_before_header', 'my_profile_before_header', 10, 1 );
  19. * function my_profile_before_header( $args ) {
  20. * // your code here
  21. * }
  22. * ?>
  23. */
  24. do_action( 'um_profile_before_header', $args );
  25. if ( um_is_on_edit_profile() ) { ?>
  26. <form method="post" action="">
  27. <?php }
  28. /**
  29. * UM hook
  30. *
  31. * @type action
  32. * @title um_profile_header_cover_area
  33. * @description Profile header cover area
  34. * @input_vars
  35. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  36. * @change_log
  37. * ["Since: 2.0"]
  38. * @usage add_action( 'um_profile_header_cover_area', 'function_name', 10, 1 );
  39. * @example
  40. * <?php
  41. * add_action( 'um_profile_header_cover_area', 'my_profile_header_cover_area', 10, 1 );
  42. * function my_profile_header_cover_area( $args ) {
  43. * // your code here
  44. * }
  45. * ?>
  46. */
  47. do_action( 'um_profile_header_cover_area', $args );
  48. /**
  49. * UM hook
  50. *
  51. * @type action
  52. * @title um_profile_header
  53. * @description Profile header area
  54. * @input_vars
  55. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  56. * @change_log
  57. * ["Since: 2.0"]
  58. * @usage add_action( 'um_profile_header', 'function_name', 10, 1 );
  59. * @example
  60. * <?php
  61. * add_action( 'um_profile_header', 'my_profile_header', 10, 1 );
  62. * function my_profile_header( $args ) {
  63. * // your code here
  64. * }
  65. * ?>
  66. */
  67. do_action( 'um_profile_header', $args );
  68. /**
  69. * UM hook
  70. *
  71. * @type filter
  72. * @title um_profile_navbar_classes
  73. * @description Additional classes for profile navbar
  74. * @input_vars
  75. * [{"var":"$classes","type":"string","desc":"UM Posts Tab query"}]
  76. * @change_log
  77. * ["Since: 2.0"]
  78. * @usage
  79. * <?php add_filter( 'um_profile_navbar_classes', 'function_name', 10, 1 ); ?>
  80. * @example
  81. * <?php
  82. * add_filter( 'um_profile_navbar_classes', 'my_profile_navbar_classes', 10, 1 );
  83. * function my_profile_navbar_classes( $classes ) {
  84. * // your code here
  85. * return $classes;
  86. * }
  87. * ?>
  88. */
  89. $classes = apply_filters( 'um_profile_navbar_classes', '' ); ?>
  90. <div class="um-profile-navbar <?php echo esc_attr( $classes ); ?>">
  91. <?php
  92. /**
  93. * UM hook
  94. *
  95. * @type action
  96. * @title um_profile_navbar
  97. * @description Profile navigation bar
  98. * @input_vars
  99. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  100. * @change_log
  101. * ["Since: 2.0"]
  102. * @usage add_action( 'um_profile_navbar', 'function_name', 10, 1 );
  103. * @example
  104. * <?php
  105. * add_action( 'um_profile_navbar', 'my_profile_navbar', 10, 1 );
  106. * function my_profile_navbar( $args ) {
  107. * // your code here
  108. * }
  109. * ?>
  110. */
  111. do_action( 'um_profile_navbar', $args ); ?>
  112. <div class="um-clear"></div>
  113. </div>
  114. <?php
  115. /**
  116. * UM hook
  117. *
  118. * @type action
  119. * @title um_profile_menu
  120. * @description Profile menu
  121. * @input_vars
  122. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  123. * @change_log
  124. * ["Since: 2.0"]
  125. * @usage add_action( 'um_profile_menu', 'function_name', 10, 1 );
  126. * @example
  127. * <?php
  128. * add_action( 'um_profile_menu', 'my_profile_navbar', 10, 1 );
  129. * function my_profile_navbar( $args ) {
  130. * // your code here
  131. * }
  132. * ?>
  133. */
  134. do_action( 'um_profile_menu', $args );
  135. if ( um_is_on_edit_profile() || UM()->user()->preview ) {
  136. $nav = 'main';
  137. $subnav = UM()->profile()->active_subnav();
  138. $subnav = ! empty( $subnav ) ? $subnav : 'default'; ?>
  139. <div class="um-profile-body <?php echo esc_attr( $nav . ' ' . $nav . '-' . $subnav ); ?>">
  140. <?php
  141. /**
  142. * UM hook
  143. *
  144. * @type action
  145. * @title um_profile_content_{$nav}
  146. * @description Custom hook to display tabbed content
  147. * @input_vars
  148. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  149. * @change_log
  150. * ["Since: 2.0"]
  151. * @usage add_action( 'um_profile_content_{$nav}', 'function_name', 10, 1 );
  152. * @example
  153. * <?php
  154. * add_action( 'um_profile_content_{$nav}', 'my_profile_content', 10, 1 );
  155. * function my_profile_content( $args ) {
  156. * // your code here
  157. * }
  158. * ?>
  159. */
  160. do_action("um_profile_content_{$nav}", $args);
  161. /**
  162. * UM hook
  163. *
  164. * @type action
  165. * @title um_profile_content_{$nav}_{$subnav}
  166. * @description Custom hook to display tabbed content
  167. * @input_vars
  168. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  169. * @change_log
  170. * ["Since: 2.0"]
  171. * @usage add_action( 'um_profile_content_{$nav}_{$subnav}', 'function_name', 10, 1 );
  172. * @example
  173. * <?php
  174. * add_action( 'um_profile_content_{$nav}_{$subnav}', 'my_profile_content', 10, 1 );
  175. * function my_profile_content( $args ) {
  176. * // your code here
  177. * }
  178. * ?>
  179. */
  180. do_action( "um_profile_content_{$nav}_{$subnav}", $args ); ?>
  181. <div class="clear"></div>
  182. </div>
  183. <?php if ( ! UM()->user()->preview ) { ?>
  184. </form>
  185. <?php }
  186. } else {
  187. $menu_enabled = UM()->options()->get( 'profile_menu' );
  188. $tabs = UM()->profile()->tabs_active();
  189. $nav = UM()->profile()->active_tab();
  190. $subnav = UM()->profile()->active_subnav();
  191. $subnav = ! empty( $subnav ) ? $subnav : 'default';
  192. if ( $menu_enabled || ! empty( $tabs[ $nav ]['hidden'] ) ) { ?>
  193. <div class="um-profile-body <?php echo esc_attr( $nav . ' ' . $nav . '-' . $subnav ); ?>">
  194. <?php
  195. // Custom hook to display tabbed content
  196. /**
  197. * UM hook
  198. *
  199. * @type action
  200. * @title um_profile_content_{$nav}
  201. * @description Custom hook to display tabbed content
  202. * @input_vars
  203. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  204. * @change_log
  205. * ["Since: 2.0"]
  206. * @usage add_action( 'um_profile_content_{$nav}', 'function_name', 10, 1 );
  207. * @example
  208. * <?php
  209. * add_action( 'um_profile_content_{$nav}', 'my_profile_content', 10, 1 );
  210. * function my_profile_content( $args ) {
  211. * // your code here
  212. * }
  213. * ?>
  214. */
  215. do_action("um_profile_content_{$nav}", $args);
  216. /**
  217. * UM hook
  218. *
  219. * @type action
  220. * @title um_profile_content_{$nav}_{$subnav}
  221. * @description Custom hook to display tabbed content
  222. * @input_vars
  223. * [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
  224. * @change_log
  225. * ["Since: 2.0"]
  226. * @usage add_action( 'um_profile_content_{$nav}_{$subnav}', 'function_name', 10, 1 );
  227. * @example
  228. * <?php
  229. * add_action( 'um_profile_content_{$nav}_{$subnav}', 'my_profile_content', 10, 1 );
  230. * function my_profile_content( $args ) {
  231. * // your code here
  232. * }
  233. * ?>
  234. */
  235. do_action( "um_profile_content_{$nav}_{$subnav}", $args ); ?>
  236. <div class="clear"></div>
  237. </div>
  238. <?php }
  239. }
  240. do_action( 'um_profile_footer', $args ); ?>
  241. </div>
  242. </div>