Tribe__Events__Customizer__Widget::register_settings( WP_Customize_Section $section, WP_Customize_Manager $manager )

Create the Fields/Settings for this sections


Parameters

$section

(WP_Customize_Section) (Required) The WordPress section instance

$manager

(WP_Customize_Manager) (Required) [description]


Top ↑

Return

(void)


Top ↑

Source

File: src/Tribe/Customizer/Widget.php

	public function register_settings( WP_Customize_Section $section, WP_Customize_Manager $manager ) {
		$customizer = Tribe__Customizer::instance();

		$manager->add_setting(
			$customizer->get_setting_name( 'calendar_header_color', $section ),
			array(
				'default'              => $this->get_default( 'calendar_header_color' ),
				'type'                 => 'option',

				'sanitize_callback'    => 'sanitize_hex_color',
				'sanitize_js_callback' => 'maybe_hash_hex_color',
			)
		);

		$manager->add_control(
			new WP_Customize_Color_Control(
				$manager,
				$customizer->get_setting_name( 'calendar_header_color', $section ),
				array(
					'label'   => __( 'Calendar Header Color', 'the-events-calendar' ),
					'section' => $section->id,
				)
			)
		);

		$manager->add_setting(
			$customizer->get_setting_name( 'calendar_datebar_color', $section ),
			array(
				'default'              => $this->get_default( 'calendar_datebar_color' ),
				'type'                 => 'option',

				'sanitize_callback'    => 'sanitize_hex_color',
				'sanitize_js_callback' => 'maybe_hash_hex_color',
			)
		);

		$manager->add_control(
			new WP_Customize_Color_Control(
				$manager,
				$customizer->get_setting_name( 'calendar_datebar_color', $section ),
				array(
					'label'   => __( 'Calendar Date Bar Color', 'the-events-calendar' ),
					'section' => $section->id,
				)
			)
		);

		$manager->add_setting(
			$customizer->get_setting_name( 'featured_show_images', $section ),
			array(
				'default'              => $this->get_default( 'featured_show_images' ),
				'type'                 => 'option',
			)
		);

		$manager->add_control(
			new WP_Customize_Control(
				$manager,
				$customizer->get_setting_name( 'featured_show_images', $section ),
				array(
					'label'   => __( 'Show Featured Event Images' ),
					'section' => $section->id,
					'type'    => 'checkbox',
				)
			)
		);

		// Introduced to make Selective Refresh have less code duplication
		$customizer->add_setting_name( $customizer->get_setting_name( 'calendar_header_color', $section ) );
		$customizer->add_setting_name( $customizer->get_setting_name( 'calendar_datebar_color', $section ) );
		$customizer->add_setting_name( $customizer->get_setting_name( 'featured_show_images', $section ) );
	}