- fixed roles priority and added functions to work with roles (all|priority|um role);

- fixed um_is_core_page function with WPML;
- added general admin notice when user have old extensions;
- text changes;
This commit is contained in:
nikitozzzzzzz
2018-02-07 16:44:40 +02:00
parent 9405e941d1
commit 5ac147e41f
19 changed files with 438 additions and 351 deletions
+7 -4
View File
@@ -1165,18 +1165,21 @@ if ( ! class_exists( 'Fields' ) ) {
) {
um_fetch_user( get_current_user_id() );
if (!um_user( 'can_edit_everyone' ))
if ( ! um_user( 'can_edit_everyone' ) ) {
$disabled = ' disabled="disabled" ';
}
um_fetch_user( $_um_profile_id );
if (isset( $data['public'] ) && $data['public'] == '-2' && $data['roles']) {
if (in_array( UM()->roles()->um_get_user_role( get_current_user_id() ), $data['roles'] )) {
if ( isset( $data['public'] ) && $data['public'] == '-2' && $data['roles'] ) {
$current_user_roles = um_user( 'roles' );
if ( count( array_intersect( $current_user_roles, $data['roles'] ) ) > 0 ) {
$disabled = '';
}
}
}
if (!isset( $data['autocomplete'] )) {
if ( ! isset( $data['autocomplete'] ) ) {
$autocomplete = 'off';
}
um_fetch_user( get_current_user_id() );