mustartt / searchable-dropdown-control
WordPress Customizer Searchable Dropdown Control adds a searchable dropdown
Package info
github.com/mustartt/searchable-dropdown-control
Type:wordpress-dropin
pkg:composer/mustartt/searchable-dropdown-control
v1.0.2
2021-07-14 20:00 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2026-03-15 06:20:06 UTC
README
A searchable dropdown for wordpress customizer control
Installation
composer require mustartt/searchable-dropdown-control
Or specify custom install location
"require": { "mustartt/searchable-dropdown-control": "v1.0" }, ... "extra": { "installer-paths": { "inc/{$name}": [ "mustartt/searchable-dropdown-control" ] } }
and run
composer update
Screenshot
What it looks like in the Wordpress Customizer
Example Usage
Include in functions.php if the package is installed under inc
if ( class_exists( 'WP_Customize_Control' ) ) { require_once dirname( __FILE__ ) . '/inc/searchable-dropdown-control/searchable-dropdown-control.php'; }
Usage for customizer.php
$wp_customize->add_setting( 'font', array( 'default' => 'Roboto', 'sanitize_callback' => function ( $value ) { return $value; } ) ); $wp_customize->add_control( new Customizer_Searchable_Dropdown_Control( $wp_customize, 'font', array( 'label' => 'Select Font', 'section' => 'fonts', 'settings' => 'font', 'options' => array( 'Roboto', 'Arial', 'Helvetica', 'Calibri' ) ) ) );