at path:
ROOT
/
wp-content
/
plugins
/
elementor
/
includes
/
conditions.php
run:
R
W
Run
admin-templates
DIR
2026-04-14 05:34:14
R
W
Run
base
DIR
2026-04-14 05:34:14
R
W
Run
controls
DIR
2026-04-14 05:34:14
R
W
Run
editor-templates
DIR
2026-04-14 05:34:14
R
W
Run
elements
DIR
2026-04-14 05:34:14
R
W
Run
interfaces
DIR
2026-04-14 05:34:14
R
W
Run
libraries
DIR
2026-04-14 05:34:11
R
W
Run
managers
DIR
2026-04-14 05:34:14
R
W
Run
settings
DIR
2026-04-14 05:34:14
R
W
Run
template-library
DIR
2026-04-14 05:34:14
R
W
Run
widgets
DIR
2026-04-14 05:34:14
R
W
Run
api.php
8.61 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
autoloader.php
9.79 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
beta-testers.php
2.99 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
compatibility.php
10.96 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
conditions.php
2.7 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
db.php
15.89 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
editor-assets-api.php
2.98 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
embed.php
8.48 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
fonts.php
62.53 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
frontend.php
39.58 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
heartbeat.php
2.57 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
maintenance-mode.php
11.16 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
maintenance.php
2.81 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
plugin.php
16.49 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
preview.php
7.69 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
rollback.php
4.16 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
shapes.php
7.81 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
stylesheet.php
8.91 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
tracker.php
17 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
user-data.php
3.44 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
user.php
9.99 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
utils.php
24.36 KB
2026-04-14 05:34:14
R
W
Run
Delete
Rename
error_log
up
📄
conditions.php
Save
<?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor conditions. * * Elementor conditions handler class introduce the compare conditions and the * check conditions methods. * * @since 1.0.0 */ class Conditions { /** * Compare conditions. * * Whether the two values comply the comparison operator. * * @since 1.0.0 * @access public * @static * * @param mixed $left_value First value to compare. * @param mixed $right_value Second value to compare. * @param string $operator Comparison operator. * * @return bool Whether the two values complies the comparison operator. */ public static function compare( $left_value, $right_value, $operator ) { switch ( $operator ) { case '==': return $left_value == $right_value; case '!=': return $left_value != $right_value; case '!==': return $left_value !== $right_value; case 'in': return in_array( $left_value, $right_value, true ); case '!in': return ! in_array( $left_value, $right_value, true ); case 'contains': return in_array( $right_value, $left_value, true ); case '!contains': return ! in_array( $right_value, $left_value, true ); case '<': return $left_value < $right_value; case '<=': return $left_value <= $right_value; case '>': return $left_value > $right_value; case '>=': return $left_value >= $right_value; default: return $left_value === $right_value; } } /** * Check conditions. * * Whether the comparison conditions comply. * * @since 1.0.0 * @access public * @static * * @param array $conditions The conditions to check. * @param array $comparison The comparison parameter. * * @return bool Whether the comparison conditions comply. */ public static function check( array $conditions, array $comparison ) { $is_or_condition = isset( $conditions['relation'] ) && 'or' === $conditions['relation']; $condition_succeed = ! $is_or_condition; foreach ( $conditions['terms'] as $term ) { if ( ! empty( $term['terms'] ) ) { $comparison_result = self::check( $term, $comparison ); } else { preg_match( '/(\w+)(?:\[(\w+)])?/', $term['name'], $parsed_name ); $value = $comparison[ $parsed_name[1] ]; if ( ! empty( $parsed_name[2] ) ) { $value = $value[ $parsed_name[2] ]; } $operator = null; if ( ! empty( $term['operator'] ) ) { $operator = $term['operator']; } $comparison_result = self::compare( $value, $term['value'], $operator ); } if ( $is_or_condition ) { if ( $comparison_result ) { return true; } } elseif ( ! $comparison_result ) { return false; } } return $condition_succeed; } }