- unified `UM()->fields()->editing` and `UM()->fields()->viewing` to bool variables use true|false in conditions to make `===` or `!==` comparing;
This commit is contained in:
Mykyta Synelnikov
2023-08-15 03:49:13 +03:00
parent 766653a360
commit bfef1f9dc7
11 changed files with 222 additions and 161 deletions
+1 -1
View File
@@ -1662,7 +1662,7 @@ function um_is_user_himself() {
function um_can_edit_field( $data ) {
$can_edit = true;
if ( ! empty( UM()->fields()->editing ) && isset( UM()->fields()->set_mode ) && UM()->fields()->set_mode == 'profile' ) {
if ( true === UM()->fields()->editing && isset( UM()->fields()->set_mode ) && UM()->fields()->set_mode == 'profile' ) {
if ( ! is_user_logged_in() ) {
$can_edit = false;
} else {