$78 GRAYBYTE WORDPRESS FILE MANAGER $41

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/dantho.rw/wp-content/plugins/elementor/modules/variables/classes/

HOME
Current File : /home/bravrvjk/dantho.rw/wp-content/plugins/elementor/modules/variables/classes//css-renderer.php
<?php

namespace Elementor\Modules\Variables\Classes;

use Elementor\Modules\Variables\Storage\Repository as Variables_Repository;

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

class CSS_Renderer {
	private Variables_Repository $repository;

	public function __construct( Variables_Repository $repository ) {
		$this->repository = $repository;
	}

	private function global_variables(): array {
		return $this->repository->variables();
	}

	public function raw_css(): string {
		$list_of_variables = $this->global_variables();

		if ( empty( $list_of_variables ) ) {
			return '';
		}

		$css_entries = $this->css_entries_for( $list_of_variables );

		if ( empty( $css_entries ) ) {
			return '';
		}

		return $this->wrap_with_root( $css_entries );
	}

	private function css_entries_for( array $list_of_variables ): array {
		$entries = [];

		foreach ( $list_of_variables as $variable_id => $variable ) {
			$entry = $this->build_css_variable_entry( $variable_id, $variable );

			if ( empty( $entry ) ) {
				continue;
			}

			$entries[] = $entry;
		}

		return $entries;
	}

	private function build_css_variable_entry( string $id, array $variable ): ?string {
		$variable_name = sanitize_text_field( $id );

		if ( ! array_key_exists( 'deleted', $variable ) ) {
			$variable_name = sanitize_text_field( $variable['label'] ?? '' );
		}

		$value = sanitize_text_field( $variable['value'] ?? '' );

		if ( empty( $value ) || empty( $variable_name ) ) {
			return null;
		}

		return "--{$variable_name}:{$value};";
	}

	private function wrap_with_root( array $css_entries ): string {
		return ':root { ' . implode( ' ', $css_entries ) . ' }';
	}
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
6 Nov 2025 10.43 AM
bravrvjk / bravrvjk
0755
css-renderer.php
1.638 KB
5 Aug 2025 6.00 PM
bravrvjk / bravrvjk
0644
fonts.php
1.009 KB
5 Aug 2025 6.00 PM
bravrvjk / bravrvjk
0644
rest-api.php
13.471 KB
21 Oct 2025 3.45 PM
bravrvjk / bravrvjk
0644
style-schema.php
2.717 KB
5 Aug 2025 6.00 PM
bravrvjk / bravrvjk
0644
style-transformers.php
0.754 KB
5 Aug 2025 6.00 PM
bravrvjk / bravrvjk
0644
variable-types-registry.php
0.682 KB
15 Sep 2025 2.10 PM
bravrvjk / bravrvjk
0644
variables.php
0.447 KB
5 Aug 2025 6.00 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF