# to-top/trunk/admin/partials/customizer/customizer-custom-controls.php

To Top, version trunk. 62 lines.

- Page: https://pluginprobe.com/plugins/to-top/trunk/code/admin/partials/customizer/customizer-custom-controls.php
- Raw: https://pluginprobe.com/plugins/to-top/trunk/raw/admin/partials/customizer/customizer-custom-controls.php
- Modified: 2026-05-28T06:05:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/to-top/trunk/code/admin/partials/customizer/customizer-custom-controls.php#L10-L20`.

```php
<?php

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

/**
 * @package Catch Plugins
 * @subpackage To Top
 * @since To Top 1.0
 */


//Custom control for icons
class To_Top_Custom_Icons extends WP_Customize_Control
{

	private $icon_options = array(
		'dashicons-arrow-up'      => 'Arrow Up',
		'dashicons-arrow-up-alt'  => 'Arrow Up Alt',
		'dashicons-arrow-up-alt2' => 'Arrow Up Alt 2',
	);

	public function render_content()
	{
		$output  = '';
		$output .= '<label>';
		$output .= '<span class="customize-control-title">' . esc_html($this->label) . '</span>';

		$output .= '<select ' . $this->get_link() . ' id="to-top-customizer-icon-type">';

		foreach ($this->icon_options as $key => $value) {
			$output .= '<option class="dashicons ' . esc_attr($key) . '" value="' . esc_attr($key) . '">';
			$output .= esc_html($value);
			$output .= '</option>';
		}

		$output .= '</select>';
		$output .= '</label>';

		$allowed_select_html = array(
			'label' => array(),
			'span'  => array(
				'class' => true,
			),
			'select' => array(
				'id'   => true,
				'name' => true,
				'class' => true,
				'data-customize-setting-link' => true,
			),
			'option' => array(
				'value'    => true,
				'class'    => true,
				'selected' => true,
			),
		);

		echo wp_kses($output, $allowed_select_html);
	}
}

```
