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