PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 2.7.1
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v2.7.1
4.0.3 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 All 341 releases
← All changes | admin/general-settings.php +172 -49 2.0.4 → 2.7.1 View file →
@@ -6,18 +6,15 @@
6 6 *
7 7 * @return void
8 8 */
9 9 function wppb_register_general_settings_submenu_page() {
10 - add_submenu_page( 'profile-builder', __( 'General Settings', 'profilebuilder' ), __( 'General Settings', 'profilebuilder' ), 'manage_options', 'profile-builder-general-settings', 'wppb_general_settings_content' );
10 + add_submenu_page( 'profile-builder', __( 'General Settings', 'profile-builder' ), __( 'General Settings', 'profile-builder' ), 'manage_options', 'profile-builder-general-settings', 'wppb_general_settings_content' );
11 11 }
12 12 add_action( 'admin_menu', 'wppb_register_general_settings_submenu_page', 3 );
13 13
14 14
15 15 function wppb_generate_default_settings_defaults(){
16 - $wppb_general_settings = get_option( 'wppb_general_settings', 'not_found' );
17 -
18 - if ( $wppb_general_settings == 'not_found' )
19 - update_option( 'wppb_general_settings', array( 'extraFieldsLayout' => 'default', 'emailConfirmation' => 'no', 'activationLandingPage' => '', 'adminApproval' => 'no', 'loginWith' => 'username' ) );
16 + add_option( 'wppb_general_settings', array( 'extraFieldsLayout' => 'default', 'emailConfirmation' => 'no', 'activationLandingPage' => '', 'adminApproval' => 'no', 'loginWith' => 'usernameemail', 'rolesEditor' => 'no', 'contentRestriction' => 'no' ) );
20 17 }
21 18
22 19
23 20 /**
@@ -34,55 +31,48 @@
34 31 <form method="post" action="options.php#general-settings">
35 32 <?php $wppb_generalSettings = get_option( 'wppb_general_settings' ); ?>
36 33 <?php settings_fields( 'wppb_general_settings' ); ?>
37 34
38 - <h2><?php _e( 'General Settings', 'profilebuilder' ); ?></h2>
35 + <h2><?php _e( 'General Settings', 'profile-builder' ); ?></h2>
39 36 <table class="form-table">
40 37 <tr>
41 38 <th scope="row">
42 - <?php _e( "Load Profile Builder's own CSS file in the front-end:", "profilebuilder" ); ?>
39 + <?php _e( "Load Profile Builder's own CSS file in the front-end:", "profile-builder" ); ?>
43 40 </th>
44 41 <td>
45 - <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 _e( 'Yes', 'profilebuilder' ); ?></label>
42 + <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 _e( 'Yes', 'profile-builder' ); ?></label>
46 43 <ul>
47 - <li class="description"><?php printf( __( 'You can find the default file here: %1$s', 'profilebuilder' ), '<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>' ); ?></li>
44 + <li class="description"><?php printf( __( '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>' ); ?></li>
48 45 </ul>
49 46 </td>
50 47 </tr>
51 - <?php
52 - if ( !is_multisite() ){
53 - ?>
48 +
54 49 <tr>
55 50 <th scope="row">
56 - <?php _e( '"Email Confirmation" Activated:', 'profilebuilder' );?>
51 + <?php _e( '"Email Confirmation" Activated:', 'profile-builder' );?>
57 52 </th>
58 53 <td>
59 54 <select name="wppb_general_settings[emailConfirmation]" class="wppb-select" id="wppb_settings_email_confirmation" onchange="wppb_display_page_select(this.value)">
60 - <option value="yes" <?php if ( $wppb_generalSettings['emailConfirmation'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profilebuilder' ); ?></option>
61 - <option value="no" <?php if ( $wppb_generalSettings['emailConfirmation'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profilebuilder' ); ?></option>
55 + <option value="yes" <?php if ( $wppb_generalSettings['emailConfirmation'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profile-builder' ); ?></option>
56 + <option value="no" <?php if ( $wppb_generalSettings['emailConfirmation'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profile-builder' ); ?></option>
62 57 </select>
63 58 <ul>
64 - <li class="description"><?php _e( 'On single-site installations this works with front-end forms only. Recommended to redirect WP default registration to a Profile Builder one using "Custom Redirects" addon.', 'profilebuilder' ); ?></li>
65 - <li class="description"><?php _e( 'The "Email Confirmation" feature is active (by default) on WPMU installations.', 'profilebuilder' ); ?></li>
66 - <?php if ( is_multisite() || ( $wppb_generalSettings['emailConfirmation'] == 'yes' ) ) ?>
67 - <li class="description dynamic1"><?php printf( __( 'You can find a list of unconfirmed email addresses %1$sUsers > All Users > Email Confirmation%2$s.', 'profilebuilder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/users.php?page=unconfirmed_emails">', '</a>' )?></li>
59 + <li class="description"><?php _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>
60 + <?php if ( $wppb_generalSettings['emailConfirmation'] == 'yes' ) { ?>
61 + <li class="description dynamic1"><?php printf( __( 'You can find a list of unconfirmed email addresses %1$sUsers > All Users > Email Confirmation%2$s.', 'profile-builder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/users.php?page=unconfirmed_emails">', '</a>' )?></li>
62 + <?php } ?>
68 63 </ul>
69 64 </td>
70 65 </tr>
71 - <?php
72 - }else{
73 - echo '<input type="hidden" id="wppb_general_settings_hidden" value="multisite"/>';
74 - }
75 - ?>
76 66
77 67 <tr id="wppb-settings-activation-page">
78 68 <th scope="row">
79 - <?php _e( '"Email Confirmation" Landing Page:', 'profilebuilder' ); ?>
69 + <?php _e( '"Email Confirmation" Landing Page:', 'profile-builder' ); ?>
80 70 </th>
81 71 <td>
82 72 <select name="wppb_general_settings[activationLandingPage]" class="wppb-select">
83 73 <option value="" <?php if ( empty( $wppb_generalSettings['emailConfirmation'] ) ) echo 'selected'; ?>></option>
84 - <optgroup label="<?php _e( 'Existing Pages', 'profilebuilder' ); ?>">
74 + <optgroup label="<?php _e( 'Existing Pages', 'profile-builder' ); ?>">
85 75 <?php
86 76 $pages = get_pages( apply_filters( 'wppb_page_args_filter', array( 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'post_type' => 'page', 'post_status' => array( 'publish' ) ) ) );
87 77
88 78 foreach ( $pages as $key => $value ){
@@ -95,67 +85,137 @@
95 85 ?>
96 86 </optgroup>
97 87 </select>
98 88 <p class="description">
99 - <?php _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.', 'profilebuilder' ); ?>
89 + <?php _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' ); ?>
100 90 </p>
101 91 </td>
102 92 </tr>
103 -
104 93
94 +
105 95 <?php
106 96 if ( file_exists( WPPB_PLUGIN_DIR.'/features/admin-approval/admin-approval.php' ) ){
107 97 ?>
108 98 <tr>
109 99 <th scope="row">
110 - <?php _e( '"Admin Approval" Activated:', 'profilebuilder' ); ?>
100 + <?php _e( '"Admin Approval" Activated:', 'profile-builder' ); ?>
111 101 </th>
112 102 <td>
113 103 <select id="adminApprovalSelect" name="wppb_general_settings[adminApproval]" class="wppb-select" onchange="wppb_display_page_select_aa(this.value)">
114 - <option value="yes" <?php if ($wppb_generalSettings['adminApproval'] == 'yes') echo 'selected'; ?>><?php _e( 'Yes', 'profilebuilder' ); ?></option>
115 - <option value="no" <?php if ($wppb_generalSettings['adminApproval'] == 'no') echo 'selected'; ?>><?php _e( 'No', 'profilebuilder' ); ?></option>
104 + <option value="yes" <?php if( !empty( $wppb_generalSettings['adminApproval'] ) && $wppb_generalSettings['adminApproval'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profile-builder' ); ?></option>
105 + <option value="no" <?php if( !empty( $wppb_generalSettings['adminApproval'] ) && $wppb_generalSettings['adminApproval'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profile-builder' ); ?></option>
116 106 </select>
117 107 <ul>
118 - <li class="description dynamic2"><?php printf( __( 'You can find a list of users at %1$sUsers > All Users > Admin Approval%2$s.', 'profilebuilder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/users.php?page=admin_approval&orderby=registered&order=desc">', '</a>' )?></li>
108 + <li class="description dynamic2"><?php printf( __( 'You can find a list of users at %1$sUsers > All Users > Admin Approval%2$s.', 'profile-builder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/users.php?page=admin_approval&orderby=registered&order=desc">', '</a>' )?></li>
119 109 <ul>
120 110 </td>
121 111 </tr>
122 -
112 +
113 + <tr class="dynamic2">
114 + <th scope="row">
115 + <?php _e( '"Admin Approval" on User Role:', 'profile-builder' ); ?>
116 + </th>
117 + <td>
118 + <div id="wrap">
119 + <?php
120 + $wppb_userRoles = wppb_adminApproval_onUserRole();
121 +
122 + if( ! empty( $wppb_userRoles ) ) {
123 + foreach( $wppb_userRoles as $role => $role_name ) {
124 + echo '<label><input type="checkbox" id="adminApprovalOnUserRoleCheckbox" name="wppb_general_settings[adminApprovalOnUserRole][]" class="wppb-checkboxes" value="' . esc_attr( $role ) . '"';
125 + if( ! empty( $wppb_generalSettings['adminApprovalOnUserRole'] ) && in_array( $role, $wppb_generalSettings['adminApprovalOnUserRole'] ) ) echo ' checked';
126 + if( empty( $wppb_generalSettings['adminApprovalOnUserRole'] ) ) echo ' checked';
127 + echo '>';
128 + echo $role_name . '</label><br>';
129 + }
130 + }
131 + ?>
132 + </div>
133 + <ul>
134 + <li class="description"><?php printf( __( 'Select on what user roles to activate Admin Approval.', 'profile-builder' ) ) ?></li>
135 + <ul>
136 + </td>
137 + </tr>
138 +
123 139 <?php } ?>
124 140
125 141 <?php
142 + if( file_exists( WPPB_PLUGIN_DIR.'/features/roles-editor/roles-editor.php' ) ) {
143 + ?>
144 + <tr>
145 + <th scope="row">
146 + <?php _e( '"Roles Editor" Activated:', 'profile-builder' ); ?>
147 + </th>
148 + <td>
149 + <select id="rolesEditorSelect" name="wppb_general_settings[rolesEditor]" class="wppb-select" onchange="wppb_display_page_select_re(this.value)">
150 + <option value="no" <?php if( !empty( $wppb_generalSettings['rolesEditor'] ) && $wppb_generalSettings['rolesEditor'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profile-builder' ); ?></option>
151 + <option value="yes" <?php if( !empty( $wppb_generalSettings['rolesEditor'] ) && $wppb_generalSettings['rolesEditor'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profile-builder' ); ?></option>
152 + </select>
153 + <ul>
154 + <li class="description dynamic3"><?php printf( __( 'You can add / edit user roles at %1$sUsers > Roles Editor%2$s.', 'profile-builder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/edit.php?post_type=wppb-roles-editor">', '</a>' )?></li>
155 + <ul>
156 + </td>
157 + </tr>
158 + <?php } ?>
159 +
160 + <?php
161 + if( file_exists( WPPB_PLUGIN_DIR.'/features/content-restriction/content-restriction.php' ) ) {
162 + ?>
163 + <tr>
164 + <th scope="row">
165 + <?php _e( '"Content Restriction" Activated:', 'profile-builder' ); ?>
166 + </th>
167 + <td>
168 + <select id="contentRestrictionSelect" name="wppb_general_settings[contentRestriction]" class="wppb-select" onchange="wppb_display_page_select_cr(this.value)">
169 + <option value="no" <?php if( !empty( $wppb_generalSettings['contentRestriction'] ) && $wppb_generalSettings['contentRestriction'] == 'no' ) echo 'selected'; ?>><?php _e( 'No', 'profile-builder' ); ?></option>
170 + <option value="yes" <?php if( !empty( $wppb_generalSettings['contentRestriction'] ) && $wppb_generalSettings['contentRestriction'] == 'yes' ) echo 'selected'; ?>><?php _e( 'Yes', 'profile-builder' ); ?></option>
171 + </select>
172 + <ul>
173 + <li class="description dynamic4"><?php printf( __( 'Set your settings at %1$sProfile Builder > Content Restriction%2$s and use each page / post / custom post type individual meta-box to restrict content.', 'profile-builder' ), '<a href="'.get_bloginfo( 'url' ).'/wp-admin/admin.php?page=profile-builder-content_restriction">', '</a>' )?></li>
174 + <ul>
175 + </td>
176 + </tr>
177 + <?php } ?>
178 +
179 + <?php
126 180 if ( PROFILE_BUILDER == 'Profile Builder Free' ) {
127 181 ?>
128 182 <tr>
129 183 <th scope="row">
130 - <?php _e( '"Admin Approval" Feature:', 'profilebuilder' ); ?>
184 + <?php _e( '"Admin Approval" Feature:', 'profile-builder' ); ?>
131 185 </th>
132 186 <td>
133 - <p><em> <?php printf( __( '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.', 'profilebuilder' ),'<a href="http://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=general-settings-link&utm_campaign=PBFree">', '</a>' )?></em></p>
187 + <p><em> <?php printf( __( '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>
134 188 </td>
135 189 </tr>
136 190 <?php } ?>
137 -
191 +
138 192 <tr>
139 193 <th scope="row">
140 - <?php _e( 'Allow Users to Log in With:', 'profilebuilder' ); ?>
194 + <?php _e( 'Allow Users to Log in With:', 'profile-builder' ); ?>
141 195 </th>
142 196 <td>
143 197 <select name="wppb_general_settings[loginWith]" class="wppb-select">
144 - <option value="username" <?php if ( $wppb_generalSettings['loginWith'] == 'username' ) echo 'selected'; ?>><?php _e( 'Username', 'profilebuilder' ); ?></option>
145 - <option value="email" <?php if ( $wppb_generalSettings['loginWith'] == 'email' ) echo 'selected'; ?>><?php _e( 'Email', 'profilebuilder' ); ?></option>
198 + <option value="usernameemail" <?php if ( $wppb_generalSettings['loginWith'] == 'usernameemail' ) echo 'selected'; ?>><?php _e( 'Username and Email', 'profile-builder' ); ?></option>
199 + <option value="username" <?php if ( $wppb_generalSettings['loginWith'] == 'username' ) echo 'selected'; ?>><?php _e( 'Username', 'profile-builder' ); ?></option>
200 + <option value="email" <?php if ( $wppb_generalSettings['loginWith'] == 'email' ) echo 'selected'; ?>><?php _e( 'Email', 'profile-builder' ); ?></option>
146 201 </select>
202 + <ul>
203 + <li class="description"><?php _e( '"Username and Email" - users can Log In with both Username and Email.', 'profile-builder' ); ?></li>
204 + <li class="description"><?php _e( '"Username" - users can Log In only with Username.', 'profile-builder' ); ?></li>
205 + <li class="description"><?php _e( '"Email" - users can Log In only with Email.', 'profile-builder' ); ?></li>
206 + </ul>
147 207 </td>
148 208 </tr>
149 209
150 210 <tr>
151 211 <th scope="row">
152 - <?php _e( 'Minimum Password Length:', 'profilebuilder' ); ?>
212 + <?php _e( 'Minimum Password Length:', 'profile-builder' ); ?>
153 213 </th>
154 214 <td>
155 - <input type="text" name="wppb_general_settings[minimum_password_length]" class="wppb-text" value="<?php if( !empty( $wppb_generalSettings['minimum_password_length'] ) ) echo $wppb_generalSettings['minimum_password_length']; ?>"/>
215 + <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'] ); ?>"/>
156 216 <ul>
157 - <li class="description"><?php _e( 'Enter the minimum characters the password should have. Leave empty for no minimum limit', 'profilebuilder' ); ?> </li>
217 + <li class="description"><?php _e( 'Enter the minimum characters the password should have. Leave empty for no minimum limit', 'profile-builder' ); ?> </li>
158 218 </ul>
159 219 </td>
160 220 </tr>
161 221
@@ -160,20 +220,22 @@
160 220 </tr>
161 221
162 222 <tr>
163 223 <th scope="row">
164 - <?php _e( 'Minimum Password Strength:', 'profilebuilder' ); ?>
224 + <?php _e( 'Minimum Password Strength:', 'profile-builder' ); ?>
165 225 </th>
166 226 <td>
167 227 <select name="wppb_general_settings[minimum_password_strength]" class="wppb-select">
168 - <option value=""><?php _e( 'Disabled', 'profilebuilder' ); ?></option>
169 - <option value="short" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'short' ) echo 'selected'; ?>><?php _e( 'Very weak', 'profilebuilder' ); ?></option>
170 - <option value="bad" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'bad' ) echo 'selected'; ?>><?php _e( 'Weak', 'profilebuilder' ); ?></option>
171 - <option value="good" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'good' ) echo 'selected'; ?>><?php _e( 'Medium', 'profilebuilder' ); ?></option>
172 - <option value="strong" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'strong' ) echo 'selected'; ?>><?php _e( 'Strong', 'profilebuilder' ); ?></option>
228 + <option value=""><?php _e( 'Disabled', 'profile-builder' ); ?></option>
229 + <option value="short" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'short' ) echo 'selected'; ?>><?php _e( 'Very weak', 'profile-builder' ); ?></option>
230 + <option value="bad" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'bad' ) echo 'selected'; ?>><?php _e( 'Weak', 'profile-builder' ); ?></option>
231 + <option value="good" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'good' ) echo 'selected'; ?>><?php _e( 'Medium', 'profile-builder' ); ?></option>
232 + <option value="strong" <?php if ( !empty($wppb_generalSettings['minimum_password_strength']) && $wppb_generalSettings['minimum_password_strength'] == 'strong' ) echo 'selected'; ?>><?php _e( 'Strong', 'profile-builder' ); ?></option>
173 233 </select>
174 234 </td>
175 235 </tr>
236 +
237 + <?php do_action( 'wppb_extra_general_settings', $wppb_generalSettings ); ?>
176 238 </table>
177 239
178 240
179 241
@@ -182,5 +244,66 @@
182 244 </form>
183 245 </div>
184 246
185 247 <?php
186 -}
248 +}
249 +
250 +
251 +/*
252 + * Function that sanitizes the general settings
253 + *
254 + * @param array $wppb_generalSettings
255 + *
256 + * @since v.2.0.7
257 + */
258 +function wppb_general_settings_sanitize( $wppb_generalSettings ) {
259 + $wppb_generalSettings = apply_filters( 'wppb_general_settings_sanitize_extra', $wppb_generalSettings );
260 +
261 + if( !empty( $wppb_generalSettings ) ){
262 + foreach( $wppb_generalSettings as $settings_name => $settings_value ){
263 + if( $settings_name == "minimum_password_length" || $settings_name == "activationLandingPage" )
264 + $wppb_generalSettings[$settings_name] = filter_var( $settings_value, FILTER_SANITIZE_NUMBER_INT );
265 + elseif( $settings_name == "extraFieldsLayout" || $settings_name == "emailConfirmation" || $settings_name == "adminApproval" || $settings_name == "loginWith" || $settings_name == "minimum_password_strength" )
266 + $wppb_generalSettings[$settings_name] = filter_var( $settings_value, FILTER_SANITIZE_STRING );
267 + elseif( $settings_name == "adminApprovalOnUserRole" ){
268 + if( is_array( $settings_value ) && !empty( $settings_value ) ){
269 + foreach( $settings_value as $key => $value ){
270 + $wppb_generalSettings[$settings_name][$key] = filter_var( $value, FILTER_SANITIZE_STRING );
271 + }
272 + }
273 + }
274 + }
275 + }
276 +
277 + return $wppb_generalSettings;
278 +}
279 +
280 +
281 +/*
282 + * Function that pushes settings errors to the user
283 + *
284 + * @since v.2.0.7
285 + */
286 +function wppb_general_settings_admin_notices() {
287 + settings_errors( 'wppb_general_settings' );
288 +}
289 +add_action( 'admin_notices', 'wppb_general_settings_admin_notices' );
290 +
291 +
292 +/*
293 + * Function that return user roles
294 + *
295 + * @since v.2.2.0
296 + *
297 + * @return array
298 + */
299 +function wppb_adminApproval_onUserRole() {
300 + global $wp_roles;
301 +
302 + $wp_roles = new WP_Roles();
303 +
304 + $roles = $wp_roles->get_names();
305 +
306 + unset( $roles['administrator'] );
307 +
308 + return $roles;
309 +}