# elementor/4.3.2/modules/mcp/abilities/appliers/v3/mapper/responsive-key-resolver.php

Elementor Website Builder – more than just a page builder, version 4.3.2. 63 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.3.2/code/modules/mcp/abilities/appliers/v3/mapper/responsive-key-resolver.php
- Raw: https://pluginprobe.com/plugins/elementor/4.3.2/raw/modules/mcp/abilities/appliers/v3/mapper/responsive-key-resolver.php
- Modified: 2026-09-01T11:47:36+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.3.2/code/modules/mcp/abilities/appliers/v3/mapper/responsive-key-resolver.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\Mcp\Abilities\Appliers\V3\Mapper;

use Elementor\Modules\Mcp\Abilities\Appliers\V3\Converter\V3_Context_Meta;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Decides which V3 setting key to write for a given (setting, breakpoint, is_responsive)
 * tuple. Encapsulates the "silent drop when responsive variant is absent" rule so it can
 * be shared between converters.
 */
class Responsive_Key_Resolver {

	const BASE_BREAKPOINT = 'desktop';

	/**
	 * @return string|null Suffixed key, base key, or null when the write should be dropped.
	 */
	public function resolve( string $setting, string $breakpoint, bool $is_responsive, V3_Context_Meta $meta ): ?string {
		if ( ! $is_responsive || self::BASE_BREAKPOINT === $breakpoint ) {
			return $setting;
		}

		$suffixed = $setting . '_' . $breakpoint;
		if ( ! $meta->has_control( $suffixed ) ) {
			return null;
		}

		return $suffixed;
	}

	/**
	 * Applies the responsive-suffix rule across an entire patch (typography group case).
	 *
	 * @param array<string, mixed> $patch
	 * @return array<string, mixed>
	 */
	public function suffix_patch( array $patch, string $breakpoint, V3_Context_Meta $meta ): array {
		$suffixed = [];

		foreach ( $patch as $key => $value ) {
			if ( str_ends_with( (string) $key, '_typography' ) ) {
				$suffixed[ $key ] = $value;
				continue;
			}

			$candidate = $key . '_' . $breakpoint;
			if ( $meta->has_control( $candidate ) ) {
				$suffixed[ $candidate ] = $value;
				continue;
			}

			$suffixed[ $key ] = $value;
		}

		return $suffixed;
	}
}

```
