account.php
6.77 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
<?php
/**
* Template for the account page
*
* This template can be overridden by copying it to yourtheme/ultimate-member/templates/account.php
*
* Page: "Account"
*
* @version 2.6.1
*
* @var string $mode
* @var int $form_id
* @var array $args
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?>
<div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( $form_id ); ?>">
<div class="um-form">
<form method="post" action="">
<?php
/**
* UM hook
*
* @type action
* @title um_account_page_hidden_fields
* @description Show hidden fields on account form
* @input_vars
* [{"var":"$args","type":"array","desc":"Account shortcode arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_account_page_hidden_fields', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_account_page_hidden_fields', 'my_account_page_hidden_fields', 10, 1 );
* function my_account_page_hidden_fields( $args ) {
* // your code here
* }
* ?>
*/
do_action( 'um_account_page_hidden_fields', $args ); ?>
<div class="um-account-meta radius-<?php echo esc_attr( UM()->options()->get( 'profile_photocorner' ) ); ?> uimob340-show uimob500-show">
<div class="um-account-meta-img">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>"><?php echo get_avatar( um_user( 'ID' ), 120 ); ?></a>
</div>
<div class="um-account-name">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>">
<?php echo esc_html( um_user( 'display_name' ) ); ?>
</a>
<div class="um-account-profile-link">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" class="um-link">
<?php _e( 'View profile', 'ultimate-member' ); ?>
</a>
</div>
</div>
</div>
<div class="um-account-side uimob340-hide uimob500-hide">
<div class="um-account-meta radius-<?php echo esc_attr( UM()->options()->get( 'profile_photocorner' ) ); ?>">
<div class="um-account-meta-img uimob800-hide">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>">
<?php echo get_avatar( um_user( 'ID' ), 120 ); ?>
</a>
</div>
<?php if ( UM()->mobile()->isMobile() ) { ?>
<div class="um-account-meta-img-b uimob800-show" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>">
<?php echo get_avatar( um_user( 'ID' ), 120 ); ?>
</a>
</div>
<?php } else { ?>
<div class="um-account-meta-img-b uimob800-show um-tip-<?php echo is_rtl() ? 'e' : 'w'; ?>" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>">
<?php echo get_avatar( um_user( 'ID' ), 120 ); ?>
</a>
</div>
<?php } ?>
<div class="um-account-name uimob800-hide">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>">
<?php echo um_user( 'display_name', 'html' ); ?>
</a>
<div class="um-account-profile-link">
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" class="um-link">
<?php _e( 'View profile', 'ultimate-member' ); ?>
</a>
</div>
</div>
</div>
<ul>
<?php foreach ( UM()->account()->tabs as $id => $info ) {
if ( isset( $info['custom'] ) || UM()->options()->get( "account_tab_{$id}" ) == 1 || $id == 'general' ) { ?>
<li>
<a data-tab="<?php echo esc_attr( $id )?>" href="<?php echo esc_url( UM()->account()->tab_link( $id ) ); ?>" class="um-account-link <?php if ( $id == UM()->account()->current_tab ) echo 'current'; ?>">
<?php if ( UM()->mobile()->isMobile() ) { ?>
<span class="um-account-icontip uimob800-show" title="<?php echo esc_attr( $info['title'] ); ?>">
<i class="<?php echo esc_attr( $info['icon'] ); ?>"></i>
</span>
<?php } else { ?>
<span class="um-account-icontip uimob800-show um-tip-<?php echo is_rtl() ? 'e' : 'w'; ?>" title="<?php echo esc_attr( $info['title'] ); ?>">
<i class="<?php echo esc_attr( $info['icon'] ); ?>"></i>
</span>
<?php } ?>
<span class="um-account-icon uimob800-hide">
<i class="<?php echo esc_attr( $info['icon'] ); ?>"></i>
</span>
<span class="um-account-title uimob800-hide"><?php echo esc_html( $info['title'] ); ?></span>
<span class="um-account-arrow uimob800-hide">
<i class="<?php if ( is_rtl() ) { ?>um-faicon-angle-left<?php } else { ?>um-faicon-angle-right<?php } ?>"></i>
</span>
</a>
</li>
<?php }
} ?>
</ul>
</div>
<div class="um-account-main" data-current_tab="<?php echo esc_attr( UM()->account()->current_tab ); ?>">
<?php
/**
* UM hook
*
* @type action
* @title um_before_form
* @description Show some content before account form
* @input_vars
* [{"var":"$args","type":"array","desc":"Account shortcode arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_before_form', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_before_form', 'my_before_form', 10, 1 );
* function my_before_form( $args ) {
* // your code here
* }
* ?>
*/
do_action( 'um_before_form', $args );
foreach ( UM()->account()->tabs as $id => $info ) {
$current_tab = UM()->account()->current_tab;
if ( isset( $info['custom'] ) || UM()->options()->get( 'account_tab_' . $id ) == 1 || $id == 'general' ) { ?>
<div class="um-account-nav uimob340-show uimob500-show">
<a href="javascript:void(0);" data-tab="<?php echo esc_attr( $id ); ?>" class="<?php if ( $id == $current_tab ) echo 'current'; ?>">
<?php echo esc_html( $info['title'] ); ?>
<span class="ico"><i class="<?php echo esc_attr( $info['icon'] ); ?>"></i></span>
<span class="arr"><i class="um-faicon-angle-down"></i></span>
</a>
</div>
<div class="um-account-tab um-account-tab-<?php echo esc_attr( $id ); ?>" data-tab="<?php echo esc_attr( $id )?>">
<?php $info['with_header'] = true;
UM()->account()->render_account_tab( $id, $info, $args ); ?>
</div>
<?php }
} ?>
</div>
<div class="um-clear"></div>
</form>
<?php
/**
* UM hook
*
* @type action
* @title um_after_account_page_load
* @description After account form
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_after_account_page_load', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_after_account_page_load', 'my_after_account_page_load', 10 );
* function my_after_account_page_load() {
* // your code here
* }
* ?>
*/
do_action( 'um_after_account_page_load' ); ?>
</div>
</div>