To add anything to the Customizer, you need to use the customize_register action hook. Common Controls include things like Checkboxes, Select Lists and Radio Buttons, just to name a few. Settings associate Controls with the settings that are saved in the database.Ĭontrols are the actual UI Elements. You’ll typically have multiple Controls in each Section. They allow you to group multiple Sections together. Panels, Sections, Settings, and Controls. There are four main types of Customizer objects that you need to deal with when adding theme options to the Customizer. Hopefully though, if you’re adding Customizer functionality to your theme, the following details, along with Part 2 of this post, will come in handy. This is considered the canonical, official documentation for the Customize API outside of the inline documentation within the core code.Ĭonsidering the push for people to use the Customizer, especially developers, it’s disheartening to see the lack of decent official documentation.
It is strongly recommended that developers study the core customizer code (all core files containing “customize”). I’ve talked about the Customizer in the past and one of the (many) things I find frustating about it is the lack of decent documentation for developers, with the Theme Handbook even going so far as to suggest that you need to study all the Customizer code in Core. It was even made mandatory (almost two years ago now), that any theme being submitted to the Theme Directory (on ) and that also includes theme options, must now use the WordPress Customizer. Whether you like the WordPress Customizer or not, it’s not going anywhere (unfortunately). These include the Site Identity, Menus, Widgets, Static Front Page, and (since WordPress 4.7) Additional CSS. The Customizer was built to provide theme developers with a standard interface they could use when providing customisation options within their theme.Įven if the theme you’re using doesn’t provide any additional theme options, there are certain core features that the Customizer will allow you to change and live-preview with any theme. The WordPress Customizer allows users to modify and configure theme options, whilst also providing them with a live-preview of those changes. If you’ve used WordPress in the last couple of years, you’re no doubt familiar with, or have at least heard of, the Customizer.