# elementor/4.3.0-beta3/core/frontend/widget-content-render-mode.php

Elementor Website Builder – more than just a page builder, version 4.3.0-beta3. 45 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.3.0-beta3/code/core/frontend/widget-content-render-mode.php
- Raw: https://pluginprobe.com/plugins/elementor/4.3.0-beta3/raw/core/frontend/widget-content-render-mode.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.0-beta3/code/core/frontend/widget-content-render-mode.php#L10-L20`.

```php
<?php
namespace Elementor\Core\Frontend;

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

class Widget_Content_Render_Mode {

	const NORMAL = 'normal';

	const MARKDOWN = 'markdown';

	private static $current_mode = self::NORMAL;

	public static function get_current(): string {
		return self::$current_mode;
	}

	public static function set_current( string $mode ): void {
		self::$current_mode = $mode;
	}

	public static function is( string $mode ): bool {
		return self::get_current() === $mode;
	}

	public static function execute_as( string $mode, callable $callback ) {
		$previous_mode = self::get_current();
		$should_reset = $previous_mode !== $mode;

		if ( $should_reset ) {
			self::set_current( $mode );
		}

		try {
			return $callback();
		} finally {
			if ( $should_reset ) {
				self::set_current( $previous_mode );
			}
		}
	}
}

```
