<?php

class GlobalStylesColorCustomizer {

	private $section_key = 'customize-global-styles-colors';

	public function __construct() {
		add_action( 'customize_register', array( $this, 'initialize' ) );
	}

	public function initialize( $wp_customize ) {
		$theme = wp_get_theme();
		$wp_customize->add_section(
			$this->section_key,
			array(
				'capability'  => 'edit_theme_options',
				/* translators: Theme name */
				'description' => sprintf( __( 'Color Customization for %1$s', 'furnizo' ), $theme->name ),
				'title'       => __( 'Colors', 'furnizo' ),
			)
		);

		$wp_customize->add_control(
			$this->section_key . '-migration-notice',
			array(
				'type'        => 'hidden',
				'description' => '<div class="notice notice-info">
				<p>' . __( 'Color customization for this theme is now available exclusively in the Full Site Editor Global Styles panel.<br><br>Featured Palettes can now be found in the Full Site Editor as Theme Variations.', 'furnizo' ) . '</p>
				</div>',
				'settings'    => array(),
				'section'     => $this->section_key,
			)
		);

		$wp_customize->add_control(
			$this->section_key . '-site-editor-button',
			array(
				'type'        => 'hidden',
				'description' => sprintf( '<a class="button button-primary" href=%s style="font-style: normal;" >Use Site Editor</a>', esc_url( admin_url( 'site-editor.php?styles=open' ) ) ),
				'settings'    => array(),
				'section'     => $this->section_key,
			)
		);
	}

}

new GlobalStylesColorCustomizer();
