<?php
/**
 * Customizer settings: cursor
 *
 * @package Multi
 */

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

/**
 * Customizer settings for cursor
 */
class Multimagazine_Customize_Cursor {

	/**
	 * Registers the section and fires the extension hook.
	 *
	 * @param WP_Customize_Manager $wp_customize Customizer manager instance.
	 */
	public static function register_section( $wp_customize ) {
		$wp_customize->add_section(
			'cursor',
			array(
				'title'    => __( 'Cursor', 'multimagazine' ),
				'priority' => 62,
			)
		);
		do_action( 'multimagazine_customize_cursor', $wp_customize );
	}

	/**
	 * Registers the cursor setting.
	 */
	public static function register_cursor() {
		global $multimagazine_customize;
		$multimagazine_customize->select_setting(
			'multi_cursor',
			'cursor',
			array(
				0 => __( 'Browser default', 'multimagazine' ),
				1 => __( 'Dot', 'multimagazine' ),
				2 => __( 'Dot with magnetic circle', 'multimagazine' ),
			),
			__( 'Cursor', 'multimagazine' )
		);
	}

	/**
	 * Registers the cursor color setting.
	 */
	public static function register_cursor_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_cursor_color', 'cursor', __( 'Cursor color', 'multimagazine' ), '', 'postMessage' );
	}
}

add_action( 'customize_register', array( 'Multimagazine_Customize_Cursor', 'register_section' ) );
add_action( 'multimagazine_customize_cursor', array( 'Multimagazine_Customize_Cursor', 'register_cursor' ), 10 );
add_action( 'multimagazine_customize_cursor', array( 'Multimagazine_Customize_Cursor', 'register_cursor_color' ), 15 );
