Astra_Update_Global_Palette::get_input_schema()

Get input schema.


Description


Return

(array)


Source

File: inc/abilities/customizer/globals/colors/class-astra-update-global-palette.php

	public function get_input_schema() {
		return array(
			'type'       => 'object',
			'properties' => array(
				'preset'         => array(
					'type'        => 'string',
					'description' => 'The preset name to apply (e.g., "Oak", "Lily", "Viola", "Cedar", "Willow", "Rose", "Sage", "Flare", "Maple", "Birch", "Dark"). This will apply all preset colors.',
					'enum'        => array( 'Oak', 'Lily', 'Viola', 'Cedar', 'Willow', 'Rose', 'Sage', 'Flare', 'Maple', 'Birch', 'Dark' ),
				),
				'palette_id'     => array(
					'type'        => 'string',
					'description' => 'The palette ID to update (palette_1, palette_2, palette_3, palette_4). If not provided, updates the current active palette.',
					'enum'        => array( 'palette_1', 'palette_2', 'palette_3', 'palette_4' ),
				),
				'colors'         => array(
					'type'        => 'object',
					'description' => 'Color values to update. Use color index (0-8) as keys and hex color values. Example: {"0": "#046bd2", "1": "#045cb4"}. These will override preset colors if both are provided.',
					'properties'  => array(
						'0' => array(
							'type'        => 'string',
							'description' => 'Color 0 - Primary color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'1' => array(
							'type'        => 'string',
							'description' => 'Color 1 - Primary hover color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'2' => array(
							'type'        => 'string',
							'description' => 'Color 2 - Heading color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'3' => array(
							'type'        => 'string',
							'description' => 'Color 3 - Text color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'4' => array(
							'type'        => 'string',
							'description' => 'Color 4 - Background color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'5' => array(
							'type'        => 'string',
							'description' => 'Color 5 - Secondary background color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'6' => array(
							'type'        => 'string',
							'description' => 'Color 6 - Border color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'7' => array(
							'type'        => 'string',
							'description' => 'Color 7 - Secondary border color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
						'8' => array(
							'type'        => 'string',
							'description' => 'Color 8 - Accent color (hex format)',
							'pattern'     => '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
						),
					),
				),
				'set_as_current' => array(
					'type'        => 'boolean',
					'description' => 'If true, sets this palette as the currently active palette.',
					'default'     => true,
				),
			),
		);
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.