# elementor/4.2.1/modules/interactions/validators/string-value.php

Elementor Website Builder – more than just a page builder, version 4.2.1. 30 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.2.1/code/modules/interactions/validators/string-value.php
- Raw: https://pluginprobe.com/plugins/elementor/4.2.1/raw/modules/interactions/validators/string-value.php
- Modified: 2026-03-30T09:49:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/4.2.1/code/modules/interactions/validators/string-value.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\Interactions\Validators;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class String_Value {
	public static function is_valid( $prop_value, $allowed_values = null ) {
		if ( ! is_array( $prop_value ) ) {
			return false;
		}

		if ( ! isset( $prop_value['$$type'] ) || 'string' !== $prop_value['$$type'] ) {
			return false;
		}

		if ( ! isset( $prop_value['value'] ) || ! is_string( $prop_value['value'] ) ) {
			return false;
		}

		if ( null !== $allowed_values && ! in_array( $prop_value['value'], $allowed_values, true ) ) {
			return false;
		}

		return true;
	}
}

```
