PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 3.1
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v3.1
4.16.18 4.16.17 4.16.16 trunk 1.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5a 1.1.6 1.1.7 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7 1.7.1 1.7.2 1.8 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.1.9 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.2 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.10.2 4.10.3 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.15.0 4.15.1 4.15.10 4.15.11 4.15.12 4.15.13 4.15.14 4.15.15 4.15.16 4.15.17 4.15.18 4.15.19 4.15.2 4.15.20 4.15.20.1 4.15.21 4.15.22 4.15.23 4.15.24 4.15.25 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.0 4.16.1 4.16.10 4.16.11 4.16.12 4.16.13 4.16.14 4.16.15 4.16.2 4.16.3 4.16.4 4.16.5 4.16.6 4.16.7 4.16.8 4.16.9 4.2.0 4.3.0 4.3.1 4.3.2 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.7.0 4.8.0 4.9.0
wp-user-avatar / src / ShortcodeParser / MyAccount / edit-profile.tmpl.php
wp-user-avatar / src / ShortcodeParser / MyAccount Last commit date
MyAccountTag.php 5 years ago change-password.tmpl.php 5 years ago dashboard.tmpl.php 5 years ago edit-profile.tmpl.php 5 years ago email-notifications.tmpl.php 5 years ago index.php 5 years ago
edit-profile.tmpl.php
201 lines
1 <?php
2
3 use ProfilePress\Core\Classes\EditUserProfile;
4 use ProfilePress\Core\Classes\ExtensionManager;
5 use ProfilePress\Core\Classes\PROFILEPRESS_sql;
6 use ProfilePress\Core\Classes\UserAvatar;
7
8 if ( ! defined('ABSPATH')) {
9 exit; // Exit if accessed directly
10 }
11
12 $current_user_id = get_current_user_id();
13
14 $contact_infos = [];
15 $custom_fields = [];
16
17 if (ExtensionManager::is_enabled(ExtensionManager::CUSTOM_FIELDS)) {
18
19 $contact_infos = PROFILEPRESS_sql::get_contact_info_fields();
20
21 $custom_fields = PROFILEPRESS_sql::get_profile_custom_fields();
22 }
23
24 $success_message = EditUserProfile::get_success_message();
25
26 $custom_edit_profile = ppress_settings_by_key('myac_account_details_form', 'default', true);
27
28 $sub_menus = apply_filters('ppress_my_account_settings_sub_menus', ['general' => esc_html__('General', 'wp-user-avatar')]);
29 ?>
30 <div class="profilepress-myaccount-edit-profile">
31
32 <h2><?= esc_html__('Account Settings', 'wp-user-avatar') ?></h2>
33
34 <?php if (is_array($sub_menus) && count($sub_menus) > 1) : ?>
35 <div class="profilepress-myaccount-submenus-wrap">
36
37 <?php foreach ($sub_menus as $menu_id => $sub_menu) : ?>
38
39 <?php $is_active = ( ! isset($_GET['epview']) && $menu_id == 'general') || (isset($_GET['epview']) && $_GET['epview'] == $menu_id) ? ' ppsubmenu-active' : ''; ?>
40
41 <div class="profilepress-myaccount-submenu-wrap">
42 <a href="<?= esc_url(remove_query_arg('edit', add_query_arg('epview', $menu_id))) ?>" class="profilepress-myaccount-submenu-item<?= $is_active ?>">
43 <?= $sub_menu ?>
44 </a>
45 </div>
46
47 <?php endforeach; ?>
48
49 </div>
50 <?php endif; ?>
51
52 <?php if (isset($_GET['edit']) && $_GET['edit'] == 'true') : ?>
53 <?= $success_message ?>
54 <?php endif; ?>
55
56 <?php if ( ! empty($this->edit_profile_form_error)) : ?>
57
58 <?php if (strpos($this->edit_profile_form_error, 'profilepress-edit-profile-status') !== false) : ?>
59 <?= $this->edit_profile_form_error ?>
60 <?php else : ?>
61 <div class="profilepress-edit-profile-status">
62 <?= $this->edit_profile_form_error ?>
63 </div>
64 <?php endif; ?>
65
66 <?php endif; ?>
67
68 <?php
69
70 if ('default' !== $custom_edit_profile) {
71 echo do_shortcode(sprintf('[profilepress-edit-profile id="%s"]', absint($custom_edit_profile)), true);
72 } elseif ( ! empty($_GET['epview']) && $_GET['epview'] != 'general') {
73 do_action('ppress_myaccount_edit_profile_submenu_content', sanitize_text_field($_GET['epview']));
74 } else {
75
76 $cover_image_url = ppress_get_cover_image_url();
77
78 ob_start(); ?>
79 [pp-edit-profile-form]
80
81 <div class="profilepress-myaccount-form-wrap">
82
83 <div class="profilepress-myaccount-form-field">
84 <div class="ppmyac-custom-file">
85 <?= do_shortcode('[edit-profile-cover-image id="pp-cover-image" class="ppmyac-custom-file-input"]', true) ?>
86 <label for="pp-cover-image" class="ppmyac-custom-file-label" data-browse="<?= esc_html__('Browse', 'wp-user-avatar'); ?>">
87 <?= esc_html__('Cover Image (min. width: 1000px)', 'wp-user-avatar') ?>
88 </label>
89 </div>
90 </div>
91
92 <div class="profilepress-myaccount-form-field">
93 <div class="profilepress-myaccount-delete-cover-image-wrap">
94 <div class="profilepress-myaccount-cover-image">
95 <div class="profilepress-myaccount-has-cover-image" style="<?= ! $cover_image_url ? 'display:none' : '' ?>">
96 <?= do_shortcode('[pp-user-cover-image]', true); ?>
97 </div>
98 <?= do_shortcode(sprintf('[pp-remove-cover-image-button label="%s" class="ppmyac-remove-avatar"]', __('Remove', 'wp-user-avatar')), true); ?>
99 <div class="profilepress-myaccount-cover-image-empty" style="<?= $cover_image_url ? 'display:none' : '' ?>"></div>
100 </div>
101 </div>
102 </div>
103
104 <div class="profilepress-myaccount-form-field">
105 <div class="ppmyac-custom-file">
106 <?= do_shortcode('[edit-profile-avatar id="pp-avatar" class="ppmyac-custom-file-input"]', true) ?>
107 <label for="pp-avatar" class="ppmyac-custom-file-label" data-browse="<?= esc_html__('Browse', 'wp-user-avatar'); ?>">
108 <?= esc_html__('Profile picture', 'wp-user-avatar') ?>
109 </label>
110 </div>
111 </div>
112
113 <div class="profilepress-myaccount-form-field">
114 <div class="profilepress-myaccount-delete-avatar-wrap">
115 <div class="profilepress-myaccount-delete-avatar">
116 <?= UserAvatar::get_avatar_img($current_user_id); ?>
117 <?= do_shortcode(sprintf('[pp-remove-avatar-button label="%s" class="ppmyac-remove-avatar"]', __('Remove', 'wp-user-avatar')), true); ?>
118 </div>
119 </div>
120 </div>
121
122 <div class="profilepress-myaccount-form-field">
123 <label for="edit-profile-email"><?= esc_html__('Email address', 'wp-user-avatar') ?></label>
124 <?= do_shortcode('[edit-profile-email id="edit-profile-email" class="profilepress-myaccount-form-control"]', true); ?>
125 </div>
126
127 <div class="profilepress-myaccount-form-field">
128 <label for="edit-profile-first-name"><?= esc_html__('First name', 'wp-user-avatar') ?></label>
129 <?= do_shortcode('[edit-profile-first-name id="edit-profile-first-name" class="profilepress-myaccount-form-control"]', true); ?>
130 </div>
131
132 <div class="profilepress-myaccount-form-field">
133 <label for="edit-profile-last-name"><?= esc_html__('Last name', 'wp-user-avatar') ?></label>
134 <?= do_shortcode('[edit-profile-last-name id="edit-profile-last-name" class="profilepress-myaccount-form-control"]', true); ?>
135 </div>
136
137 <div class="profilepress-myaccount-form-field">
138 <label for="edit-profile-nickname"><?= esc_html__('Nickname', 'wp-user-avatar') ?></label>
139 <?= do_shortcode('[edit-profile-nickname id="edit-profile-nickname" class="profilepress-myaccount-form-control"]', true); ?>
140 </div>
141
142 <div class="profilepress-myaccount-form-field">
143 <label for="eup_display_name"><?= esc_html__('Display name publicly as', 'wp-user-avatar') ?></label>
144 <?php $this->display_name_select_dropdown(); ?>
145 </div>
146
147 <div class="profilepress-myaccount-form-field">
148 <label for="edit-profile-website"><?= esc_html__('Website', 'wp-user-avatar') ?></label>
149 <?= do_shortcode('[edit-profile-website id="edit-profile-website" class="profilepress-myaccount-form-control"]', true); ?>
150 </div>
151
152 <div class="profilepress-myaccount-form-field">
153 <label for="edit-profile-bio"><?= esc_html__('About yourself', 'wp-user-avatar') ?></label>
154 <?= do_shortcode('[edit-profile-bio id="edit-profile-bio" class="profilepress-myaccount-form-control"]', true); ?>
155 </div>
156
157 <?php if (is_array($contact_infos) && ! empty($contact_infos)) : ?>
158
159 <?php foreach ($contact_infos as $field_key => $label) : ?>
160 <div class="profilepress-myaccount-form-field">
161 <label for="<?= $field_key ?>"><?= $label ?></label>
162 <?= do_shortcode(sprintf('[edit-profile-cpf key="%1$s" id="%1$s" type="%2$s" class="profilepress-myaccount-form-control"]', $field_key, 'text'), true) ?>
163 </div>
164 <?php endforeach; ?>
165
166 <?php endif; ?>
167
168 <?php if (is_array($custom_fields) && ! empty($custom_fields)) : ?>
169
170 <?php foreach ($custom_fields as $custom_field) : ?>
171 <?php
172 $field_key = $custom_field['field_key'];
173 // skip woocommerce core billing / shipping fields added to wordpress profile admin page.
174 if (in_array($field_key, ppress_woocommerce_billing_shipping_fields())) continue;
175 ?>
176 <div class="profilepress-myaccount-form-field">
177 <?php if ($custom_field['type'] !== 'agreeable') : ?>
178 <label for="<?= $field_key ?>"><?= $custom_field['label_name'] ?></label>
179 <?php endif; ?>
180 <?= do_shortcode(sprintf('[edit-profile-cpf id="%1$s" key="%1$s" type="%2$s" class="profilepress-myaccount-form-control"]', $field_key, $custom_field['type'])) ?>
181 </div>
182 <?php endforeach; ?>
183
184 <?php endif; ?>
185
186 <div class="profilepress-myaccount-form-field">
187 <?= do_shortcode('[edit-profile-submit]', true); ?>
188 </div>
189 </div>
190
191 <input type="hidden" name="ppmyac_form_action" value="updateProfile">
192
193 [/pp-edit-profile-form]
194
195 <?= do_shortcode(ob_get_clean(), true);
196 }
197 ?>
198 </div>
199 <?php
200
201 do_action('ppress_myaccount_edit_profile');