More yoda conditions

This commit is contained in:
David Stone
2025-02-09 12:30:02 -07:00
parent d9122a410d
commit 0a4c81c105
97 changed files with 323 additions and 289 deletions

View File

@ -423,7 +423,7 @@ class Login_Form_Element extends Base_Element {
/*
* Handles maintenance mode on Elementor.
*/
if ($post && $post->ID === absint(wu_get_setting('default_login_page', 0))) {
if ($post && absint(wu_get_setting('default_login_page', 0)) === $post->ID) {
add_filter('elementor/maintenance_mode/is_login_page', '__return_true');
}
}
@ -749,9 +749,9 @@ class Login_Form_Element extends Base_Element {
if (isset($_GET['redirect_to'])) {
$atts['redirect_type'] = 'query_redirect';
$fields['redirect_to']['value'] = $_GET['redirect_to'];
} elseif ($atts['redirect_type'] === 'customer_site') {
} elseif ('customer_site' === $atts['redirect_type']) {
$fields['redirect_to']['value'] = $atts['customer_redirect_path'];
} elseif ($atts['redirect_type'] === 'main_site') {
} elseif ('main_site' === $atts['redirect_type']) {
$fields['redirect_to']['value'] = $atts['main_redirect_path'];
}