Everywhere yoda conditions are

This commit is contained in:
David Stone
2025-02-09 00:20:10 -07:00
parent d74f6d1a53
commit be0ab98895
213 changed files with 691 additions and 412 deletions

View File

@ -441,7 +441,7 @@ class General_Compat {
$file_path = get_parent_theme_file_path('includes/lib/inc/functions.php');
if ($theme === 'avada' && file_exists($file_path)) {
if ('avada' === $theme && file_exists($file_path)) {
require_once get_parent_theme_file_path('includes/lib/inc/functions.php');

View File

@ -375,14 +375,14 @@ class Legacy_Shortcodes {
'required' => true,
'pricing_table_products' => implode(',', wu_get_plans($search_arguments)),
'pricing_table_template' => $layout,
'element_classes' => $layout === 'legacy' ? 'wu-content-plan' : '',
'element_classes' => 'legacy' === $layout ? 'wu-content-plan' : '',
];
/**
* If not using the legacy checkout,
* we'll need a submit field.
*/
if ($layout !== 'legacy') {
if ('legacy' !== $layout) {
$fields[] = [
'step' => 'checkout',
'name' => __('Get Started →', 'wp-ultimo'),
@ -528,7 +528,7 @@ class Legacy_Shortcodes {
'template_selection_sites' => implode(',', $templates ?: wu_get_site_templates($search_arguments)),
'template_selection_template' => $layout,
'cols' => $atts['cols'],
'element_classes' => $layout === 'legacy' ? 'wu-content-templates' : '',
'element_classes' => 'legacy' === $layout ? 'wu-content-templates' : '',
];
$steps = [
@ -589,6 +589,7 @@ class Legacy_Shortcodes {
]
);
}
/**
* Makes sure we don't return any invalid values.
*

View File

@ -224,7 +224,7 @@ class Multiple_Accounts_Compat {
* belong to the sub-site in question, so we unset the user
* currently logged in.
*/
if ($has_user === false) {
if (false === $has_user) {
wu_x_header('X-Ultimo-Multiple-Accounts: user-unset');
$current_user = null;
@ -305,7 +305,7 @@ class Multiple_Accounts_Compat {
*/
public function add_column_content($null, $column, $user_id): void {
if ($column === 'multiple_accounts') {
if ('multiple_accounts' === $column) {
// Get user email
$user = get_user_by('ID', $user_id);
@ -399,6 +399,7 @@ class Multiple_Accounts_Compat {
// If nothing was found return false;
return $has_user;
}
/**
* Gets the right user when logging-in.
*
@ -457,6 +458,7 @@ class Multiple_Accounts_Compat {
return $can;
}
/**
* Gets the right user for a given domain.
*
@ -477,7 +479,7 @@ class Multiple_Accounts_Compat {
// Loop the results and check which one is in this group
foreach ($users->results as $user_with_email) {
$conditions = $password == false ? true : wp_check_password($password, $user_with_email->user_pass, $user_with_email->ID);
$conditions = false == $password ? true : wp_check_password($password, $user_with_email->user_pass, $user_with_email->ID);
// Check for the pertinence of that user in this site
if ($conditions && $this->user_can_for_blog($user_with_email, get_current_blog_id(), 'read')) {