PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 3.7.5
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v3.7.5
4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 All 340 releases
profile-builder / admin / general-settings.php

general-settings.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 3.7.5, at admin/general-settings.php

415 lines 20.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3 /**
4 * Function that returns an array with the settings tabs(pages) and secondary tabs( can be sub-pages (we load a registered page as a secondary tab) or actual sub-tabs )
5 * @return array with the tabs
6 */
7 function wppb_get_settings_pages(){
8 $wppb_module_settings = get_option('wppb_module_settings');
9
10 $settings_pages['pages'] = array(
11 'profile-builder-general-settings' => __( 'General Settings', 'profile-builder' ),
12 'profile-builder-admin-bar-settings' => __( 'Admin Bar', 'profile-builder' ),
13 'profile-builder-content_restriction' => __( 'Content Restriction', 'profile-builder' ),
14 'profile-builder-private-website' => __( 'Private Website', 'profile-builder' ),
15 'profile-builder-toolbox-settings' => __( 'Advanced Settings', 'profile-builder' ),
16 );
17
18 //add tabs here for Advanced Settings
19 $settings_pages['sub-tabs']['profile-builder-toolbox-settings']['forms'] = __( 'Forms', 'profile-builder' );
20 $settings_pages['sub-tabs']['profile-builder-toolbox-settings']['fields'] = __( 'Fields', 'profile-builder' );
21
22 if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons/add-ons.php' ) && isset( $wppb_module_settings['wppb_userListing'] ) && $wppb_module_settings['wppb_userListing'] === 'show' )
23 $settings_pages['sub-tabs']['profile-builder-toolbox-settings']['userlisting'] = __( 'Userlisting', 'profile-builder' );
24
25 $settings_pages['sub-tabs']['profile-builder-toolbox-settings']['shortcodes'] = __( 'Shortcodes', 'profile-builder' );
26 $settings_pages['sub-tabs']['profile-builder-toolbox-settings']['admin'] = __( 'Admin', 'profile-builder' );
27
28 //add tab for 2FA
29 if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists(WPPB_PAID_PLUGIN_DIR . '/features/two-factor-authentication/class-two-factor-authentication.php')) {
30 $settings_pages['pages']['profile-builder-two-factor-authentication'] = __( 'Two-Factor Authentication', 'profile-builder' );
31 }
32
33 //add sub-pages here for email customizer
34 if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR . '/add-ons/add-ons.php' ) ) {
35 if( ( isset($wppb_module_settings['wppb_emailCustomizerAdmin']) && $wppb_module_settings['wppb_emailCustomizerAdmin'] == 'show' ) || ( isset($wppb_module_settings['wppb_emailCustomizer']) && $wppb_module_settings['wppb_emailCustomizer'] == 'show') ){
36 $settings_pages['pages']['user-email-customizer'] = __( 'Email Customizer', 'profile-builder' );
37 $settings_pages['sub-pages']['user-email-customizer']['user-email-customizer'] = __( 'User Emails', 'profile-builder' );
38 $settings_pages['sub-pages']['user-email-customizer']['admin-email-customizer'] = __( 'Administrator Emails', 'profile-builder' );
39 }
40 }
41
42 return $settings_pages;
43 }
44
45 /**
46 * Function that generates the html for the tabs and subtabs on the settings page
47 */
48 function wppb_generate_settings_tabs(){
49 ?>
50 <nav class="nav-tab-wrapper">
51 <?php
52 $pages = wppb_get_settings_pages();
53
54 $active_tab = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
55 //if we are on a subpage we need to change the active tab to the parent
56 if( !empty( $pages['sub-pages'] ) ) {
57 foreach ($pages['sub-pages'] as $parent_slug => $subpages) {
58 if (array_key_exists($active_tab, $subpages)) {
59 $active_tab = $parent_slug;
60 }
61 }
62 }
63
64 foreach( $pages['pages'] as $page_slug => $tab_name ){
65 echo '<a href="' . esc_url( admin_url( add_query_arg( array( 'page' => $page_slug ), 'admin.php' ) ) ) . '" class="nav-tab ' . ( $active_tab == $page_slug ? 'nav-tab-active' : '' ) . '">'. esc_html( $tab_name ) .'</a>';
66 }
67 ?>
68 </nav>
69 <?php
70
71 // this is not always the same as the active tab
72 $active_subpage = sanitize_text_field($_GET['page']);
73
74 if( !empty( $pages['sub-pages'] ) ) {
75 foreach ($pages['sub-pages'] as $parent_slug => $subpages) {
76 if (array_key_exists( sanitize_text_field( $active_subpage ), $subpages)) {
77 echo '<ul class="wppb-subtabs subsubsub">';
78 foreach ($subpages as $subpage_slug => $subpage_name) {
79 echo '<li><a href="' . esc_url( admin_url( add_query_arg(array('page' => $subpage_slug), 'admin.php') ) ) . '" class="nav-sub-tab ' . ($active_subpage == $subpage_slug ? 'current' : '') . '">' . esc_html( $subpage_name ) . '</a></li>';
80 }
81 echo '</ul>';
82 }
83 }
84 }
85
86 if( !empty( $pages['sub-tabs'] ) ) {
87 foreach ($pages['sub-tabs'] as $parent_slug => $tabs) {
88 if ( $active_subpage == $parent_slug) {
89 echo '<ul class="wppb-subtabs subsubsub">';
90 //determine the active tab, if no tab present then default to the first one
91 if( isset($_GET['tab']) )
92 $active_tab = sanitize_text_field( $_GET['tab'] );
93 else {
94 $keys = array_keys($tabs);
95 $active_tab = array_shift( $keys );
96 }
97 foreach ($tabs as $tab_slug => $tab_name) {
98 echo '<li><a href="' . esc_url( add_query_arg( array('tab' => $tab_slug) ) ) . '" class="nav-sub-tab ' . ( $active_tab == $tab_slug ? 'current' : '') . '">' . esc_html( $tab_name ) . '</a></li>';
99 }
100 echo '</ul>';
101 }
102 }
103 }
104 }
105
106 /**
107 * Function that creates the "General Settings" submenu page
108 *
109 * @since v.2.0
110 *
111 * @return void
112 */
113 function wppb_register_general_settings_submenu_page() {
114 add_submenu_page( 'profile-builder', __( 'Settings', 'profile-builder' ), __( 'Settings', 'profile-builder' ), 'manage_options', 'profile-builder-general-settings', 'wppb_general_settings_content' );
115 }
116 add_action( 'admin_menu', 'wppb_register_general_settings_submenu_page', 3 );
117
118
119 function wppb_generate_default_settings_defaults(){
120 add_option( 'wppb_general_settings', array( 'extraFieldsLayout' => 'default', 'automaticallyLogIn' => 'No', 'emailConfirmation' => 'no', 'activationLandingPage' => '', 'adminApproval' => 'no', 'loginWith' => 'usernameemail', 'rolesEditor' => 'no', 'conditional_fields_ajax' => 'no' ) );
121 }
122
123
124 /**
125 * Function that adds content to the "General Settings" submenu page
126 *
127 * @since v.2.0
128 *
129 * @return string
130 */
131 function wppb_general_settings_content() {
132 wppb_generate_default_settings_defaults();
133 ?>
134 <div class="wrap wppb-wrap">
135 <h2><?php esc_html_e( 'Profile Builder Settings', 'profile-builder' ); ?></h2>
136
137 <?php settings_errors(); ?>
138
139 <?php wppb_generate_settings_tabs() ?>
140
141 <form method="post" action="options.php#general-settings">
142 <?php $wppb_generalSettings = get_option( 'wppb_general_settings' ); ?>
143 <?php settings_fields( 'wppb_general_settings' ); ?>
144
145 <table class="form-table">
146 <tr>
147 <th scope="row">
148 <?php esc_html_e( "Load Profile Builder's own CSS file in the front-end:", "profile-builder" ); ?>
149 </th>
150 <td>
151 <label><input type="checkbox" name="wppb_general_settings[extraFieldsLayout]"<?php echo ( ( isset( $wppb_generalSettings['extraFieldsLayout'] ) && ( $wppb_generalSettings['extraFieldsLayout'] == 'default' ) ) ? ' checked' : '' ); ?> value="default" class="wppb-select"><?php esc_html_e( 'Yes', 'profile-builder' ); ?></label>
152 <ul>
153 <li class="description"><?php printf( esc_html__( 'You can find the default file here: %1$s', 'profile-builder' ), '<a href="'.dirname( plugin_dir_url( __FILE__ ) ).'/assets/css/style-front-end.css" target="_blank">'.dirname( dirname( plugin_basename( __FILE__ ) ) ).'\assets\css\style-front-end.css</a>' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></li>
154 </ul>
155 </td>
156 </tr>
157
158 <tr>
159 <th scope="row">
160 <?php esc_html_e( 'Automatically Log In:', 'profile-builder' );?>
161 </th>
162 <td>
163 <select name="wppb_general_settings[automaticallyLogIn]" class="wppb-select" id="wppb_settings_automatically_log_in" onchange="wppb_display_page_select(this.value)">
164 <option value="Yes" <?php if ( !empty( $wppb_generalSettings['automaticallyLogIn'] ) && $wppb_generalSettings['automaticallyLogIn'] === 'Yes' ) echo 'selected'; ?>><?php esc_html_e( 'Yes', 'profile-builder' ); ?></option>
165 <option value="No" <?php if ( empty( $wppb_generalSettings['automaticallyLogIn'] ) || ( !empty( $wppb_generalSettings['automaticallyLogIn'] ) && $wppb_generalSettings['automaticallyLogIn'] === 'No' ) ) echo 'selected'; ?>><?php esc_html_e( 'No', 'profile-builder' ); ?></option>
166 </select>
167 <ul>
168 <li class="description"><?php esc_html_e( 'Select "Yes" to automatically log in new users after successful registration.', 'profile-builder' ); ?></li>
169 </ul>
170 </td>
171 </tr>
172
173 <tr>
174 <th scope="row">
175 <?php esc_html_e( '"Email Confirmation" Activated:', 'profile-builder' );?>
176 </th>
177 <td>
178 <select name="wppb_general_settings[emailConfirmation]" class="wppb-select" id="wppb_settings_email_confirmation" onchange="wppb_display_page_select(this.value)">
179 <option value="yes" <?php if ( !empty( $wppb_generalSettings['emailConfirmation'] ) && $wppb_generalSettings['emailConfirmation'] === 'yes' ) echo 'selected'; ?>><?php esc_html_e( 'Yes', 'profile-builder' ); ?></option>
180 <option value="no" <?php if ( empty( $wppb_generalSettings['emailConfirmation'] ) || ( !empty( $wppb_generalSettings['emailConfirmation'] ) && $wppb_generalSettings['emailConfirmation'] === 'no' ) ) echo 'selected'; ?>><?php esc_html_e( 'No', 'profile-builder' ); ?></option>
181 </select>
182 <ul>
183 <li class="description"><?php esc_html_e( 'This works with front-end forms only. Recommended to redirect WP default registration to a Profile Builder one using "Custom Redirects" module.', 'profile-builder' ); ?></li>
184 <?php if ( $wppb_generalSettings['emailConfirmation'] == 'yes' ) { ?>
185 <li class="description dynamic1"><?php printf( esc_html__( 'You can find a list of unconfirmed email addresses %1$sUsers > All Users > Email Confirmation%2$s.', 'profile-builder' ), '<a href="'. esc_url( get_bloginfo( 'url' ) ).'/wp-admin/users.php?page=unconfirmed_emails">', '</a>' )?></li>
186 <?php } ?>
187 </ul>
188 </td>
189 </tr>
190
191 <tr id="wppb-settings-activation-page">
192 <th scope="row">
193 <?php esc_html_e( '"Email Confirmation" Landing Page:', 'profile-builder' ); ?>
194 </th>
195 <td>
196 <select name="wppb_general_settings[activationLandingPage]" class="wppb-select">
197 <option value="" <?php if ( empty( $wppb_generalSettings['emailConfirmation'] ) ) echo 'selected'; ?>></option>
198 <optgroup label="<?php esc_html_e( 'Existing Pages', 'profile-builder' ); ?>">
199 <?php
200 $pages = get_pages( apply_filters( 'wppb_page_args_filter', array( 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'post_type' => 'page', 'post_status' => array( 'publish' ) ) ) );
201
202 foreach ( $pages as $key => $value ){
203 echo '<option value="'.esc_attr( $value->ID ).'"';
204 if ( $wppb_generalSettings['activationLandingPage'] == $value->ID )
205 echo ' selected';
206
207 echo '>' . esc_html( $value->post_title ) . '</option>';
208 }
209 ?>
210 </optgroup>
211 </select>
212 <p class="description">
213 <?php esc_html_e( 'Specify the page where the users will be directed when confirming the email account. This page can differ from the register page(s) and can be changed at any time. If none selected, a simple confirmation page will be displayed for the user.', 'profile-builder' ); ?>
214 </p>
215 </td>
216 </tr>
217
218
219 <?php
220 if ( defined( 'WPPB_PAID_PLUGIN_DIR' ) && file_exists( WPPB_PAID_PLUGIN_DIR.'/features/admin-approval/admin-approval.php' ) ){
221 ?>
222 <tr>
223 <th scope="row">
224 <?php esc_html_e( '"Admin Approval" Activated:', 'profile-builder' ); ?>
225 </th>
226 <td>
227 <select id="adminApprovalSelect" name="wppb_general_settings[adminApproval]" class="wppb-select" onchange="wppb_display_page_select_aa(this.value)">
228 <option value="yes" <?php if( !empty( $wppb_generalSettings['adminApproval'] ) && $wppb_generalSettings['adminApproval'] == 'yes' ) echo 'selected'; ?>><?php esc_html_e( 'Yes', 'profile-builder' ); ?></option>
229 <option value="no" <?php if( empty( $wppb_generalSettings['adminApproval'] ) || ( !empty( $wppb_generalSettings['adminApproval'] ) && $wppb_generalSettings['adminApproval'] == 'no' ) ) echo 'selected'; ?>><?php esc_html_e( 'No', 'profile-builder' ); ?></option>
230 </select>
231 <ul>
232 <li class="description dynamic2"><?php printf( esc_html__( 'You can find a list of users at %1$sUsers > All Users > Admin Approval%2$s.', 'profile-builder' ), '<a href="'. esc_url( get_bloginfo( 'url' ) ).'/wp-admin/users.php?page=admin_approval&orderby=registered&order=desc">', '</a>' )?></li>
233 <ul>
234 </td>
235 </tr>
236
237 <tr class="dynamic2">
238 <th scope="row">
239 <?php esc_html_e( '"Admin Approval" on User Role:', 'profile-builder' ); ?>
240 </th>
241 <td>
242 <div id="wrap">
243 <?php
244 $wppb_userRoles = wppb_adminApproval_onUserRole();
245
246 if( ! empty( $wppb_userRoles ) ) {
247 foreach( $wppb_userRoles as $role => $role_name ) {
248 echo '<label><input type="checkbox" id="adminApprovalOnUserRoleCheckbox" name="wppb_general_settings[adminApprovalOnUserRole][]" class="wppb-checkboxes" value="' . esc_attr( $role ) . '"';
249 if( ! empty( $wppb_generalSettings['adminApprovalOnUserRole'] ) && in_array( $role, $wppb_generalSettings['adminApprovalOnUserRole'] ) ) echo ' checked';
250 if( empty( $wppb_generalSettings['adminApprovalOnUserRole'] ) ) echo ' checked';
251 echo '>';
252 echo esc_html( $role_name ) . '</label><br>';
253 }
254 }
255 ?>
256 </div>
257 <ul>
258 <li class="description"><?php printf( esc_html__( 'Select on what user roles to activate Admin Approval.', 'profile-builder' ) ) ?></li>
259 <ul>
260 </td>
261 </tr>
262
263 <?php } ?>
264
265 <?php
266 if( file_exists( WPPB_PLUGIN_DIR.'/features/roles-editor/roles-editor.php' ) ) {
267 ?>
268 <tr>
269 <th scope="row">
270 <?php esc_html_e( '"Roles Editor" Activated:', 'profile-builder' ); ?>
271 </th>
272 <td>
273 <select id="rolesEditorSelect" name="wppb_general_settings[rolesEditor]" class="wppb-select" onchange="wppb_display_page_select_re(this.value)">
274 <option value="no" <?php if( !empty( $wppb_generalSettings['rolesEditor'] ) && $wppb_generalSettings['rolesEditor'] == 'no' ) echo 'selected'; ?>><?php esc_html_e( 'No', 'profile-builder' ); ?></option>
275 <option value="yes" <?php if( !empty( $wppb_generalSettings['rolesEditor'] ) && $wppb_generalSettings['rolesEditor'] == 'yes' ) echo 'selected'; ?>><?php esc_html_e( 'Yes', 'profile-builder' ); ?></option>
276 </select>
277 <ul>
278 <li class="description dynamic3"><?php printf( esc_html__( 'You can add / edit user roles at %1$sUsers > Roles Editor%2$s.', 'profile-builder' ), '<a href="'. esc_url( get_bloginfo( 'url' ) ).'/wp-admin/edit.php?post_type=wppb-roles-editor">', '</a>' )?></li>
279 <ul>
280 </td>
281 </tr>
282 <?php } ?>
283
284 <?php
285 if ( PROFILE_BUILDER == 'Profile Builder Free' ) {
286 ?>
287 <tr>
288 <th scope="row">
289 <?php esc_html_e( '"Admin Approval" Feature:', 'profile-builder' ); ?>
290 </th>
291 <td>
292 <p><em> <?php printf( esc_html__( 'You decide who is a user on your website. Get notified via email or approve multiple users at once from the WordPress UI. Enable Admin Approval by upgrading to %1$sHobbyist or PRO versions%2$s.', 'profile-builder' ),'<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=general-settings-link&utm_campaign=PBFree">', '</a>' )?></em></p>
293 </td>
294 </tr>
295 <?php } ?>
296
297 <tr>
298 <th scope="row">
299 <?php esc_html_e( 'Allow Users to Log in With:', 'profile-builder' ); ?>
300 </th>
301 <td>
302 <select name="wppb_general_settings[loginWith]" class="wppb-select">
303 <option value="usernameemail" <?php if ( $wppb_generalSettings['loginWith'] == 'usernameemail' ) echo 'selected'; ?>><?php esc_html_e( 'Username and Email', 'profile-builder' ); ?></option>
304 <option value="username" <?php if ( $wppb_generalSettings['loginWith'] == 'username' ) echo 'selected'; ?>><?php esc_html_e( 'Username', 'profile-builder' ); ?></option>
305 <option value="email" <?php if ( $wppb_generalSettings['loginWith'] == 'email' ) echo 'selected'; ?>><?php esc_html_e( 'Email', 'profile-builder' ); ?></option>
306 </select>
307 <ul>
308 <li class="description"><?php esc_html_e( '"Username and Email" - users can Log In with either their Username or their Email.', 'profile-builder' ); ?></li>
309 <li class="description"><?php esc_html_e( '"Username" - users can only Log In with their Username. Both the Username and Email fields will be shown in the front-end forms.', 'profile-builder' ); ?></li>
310 <li class="description"><?php esc_html_e( '"Email" - users can only Log In with their Email. The Username field will be hidden in the front-end forms and Usernames will be automatically generated based on the Emails.', 'profile-builder' ); ?></li>
311 </ul>
312 </td>
313 </tr>
314
315 <tr>
316 <th scope="row">
317 <?php esc_html_e( 'Minimum Password Length:', 'profile-builder' ); ?>
318 </th>
319 <td>
320 <input type="text" name="wppb_general_settings[minimum_password_length]" class="wppb-text" value="<?php if( !empty( $wppb_generalSettings['minimum_password_length'] ) ) echo esc_attr( $wppb_generalSettings['minimum_password_length'] ); ?>"/>
321 <ul>
322 <li class="description"><?php esc_html_e( 'Enter the minimum characters the password should have. Leave empty for no minimum limit', 'profile-builder' ); ?> </li>
323 </ul>
324 </td>
325 </tr>
326
327 <tr>
328 <th scope="row">
329 <?php esc_html_e( 'Minimum Password Strength:', 'profile-builder' ); ?>
330 </th>
331 <td>
332 <select name="wppb_general_settings[minimum_password_strength]" class="wppb-select">
333 <option value=""><?php esc_html_e( 'Disabled', 'profile-builder' ); ?></option>
334 <option value="short" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'short' ) echo 'selected'; ?>><?php esc_html_e( 'Very weak', 'profile-builder' ); ?></option>
335 <option value="bad" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'bad' ) echo 'selected'; ?>><?php esc_html_e( 'Weak', 'profile-builder' ); ?></option>
336 <option value="good" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'good' ) echo 'selected'; ?>><?php esc_html_e( 'Medium', 'profile-builder' ); ?></option>
337 <option value="strong" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'strong' ) echo 'selected'; ?>><?php esc_html_e( 'Strong', 'profile-builder' ); ?></option>
338 </select>
339 </td>
340 </tr>
341
342 <?php do_action( 'wppb_extra_general_settings', $wppb_generalSettings ); ?>
343 </table>
344
345
346
347 <input type="hidden" name="action" value="update" />
348 <p class="submit"><input type="submit" class="button-primary" value="<?php esc_html_e( 'Save Changes', 'profile-builder' ); ?>" /></p>
349 </form>
350 </div>
351
352 <?php
353 }
354
355
356 /*
357 * Function that sanitizes the general settings
358 *
359 * @param array $wppb_generalSettings
360 *
361 * @since v.2.0.7
362 */
363 function wppb_general_settings_sanitize( $wppb_generalSettings ) {
364 $wppb_generalSettings = apply_filters( 'wppb_general_settings_sanitize_extra', $wppb_generalSettings );
365
366 if( !empty( $wppb_generalSettings ) ){
367 foreach( $wppb_generalSettings as $settings_name => $settings_value ){
368 if( $settings_name == "minimum_password_length" || $settings_name == "activationLandingPage" )
369 $wppb_generalSettings[$settings_name] = filter_var( $settings_value, FILTER_SANITIZE_NUMBER_INT );
370 elseif( $settings_name == "extraFieldsLayout" || $settings_name == "emailConfirmation" || $settings_name == "adminApproval" || $settings_name == "loginWith" || $settings_name == "minimum_password_strength" )
371 $wppb_generalSettings[$settings_name] = filter_var( $settings_value, FILTER_SANITIZE_STRING );
372 elseif( $settings_name == "adminApprovalOnUserRole" ){
373 if( is_array( $settings_value ) && !empty( $settings_value ) ){
374 foreach( $settings_value as $key => $value ){
375 $wppb_generalSettings[$settings_name][$key] = filter_var( $value, FILTER_SANITIZE_STRING );
376 }
377 }
378 }
379 }
380 }
381
382 return $wppb_generalSettings;
383 }
384
385
386 /*
387 * Function that pushes settings errors to the user
388 *
389 * @since v.2.0.7
390 */
391 function wppb_general_settings_admin_notices() {
392 settings_errors( 'wppb_general_settings' );
393 }
394 add_action( 'admin_notices', 'wppb_general_settings_admin_notices' );
395
396
397 /*
398 * Function that return user roles
399 *
400 * @since v.2.2.0
401 *
402 * @return array
403 */
404 function wppb_adminApproval_onUserRole() {
405 global $wp_roles;
406
407 $wp_roles = new WP_Roles();
408
409 $roles = $wp_roles->get_names();
410
411 unset( $roles['administrator'] );
412
413 return $roles;
414 }
415