Layers_Customize_Control

Last Updated:
Back to Main Index

Layers_Customize_Control()  is a PHP class which outputs commonly used form elements when building Customizer Controls. Unlike the WordPress Customizer API, this class makes it much easier to build customizer controls by filtering with layers_customizer_panelslayers_customizer_sections and layers_customizer_controls.

You do not need to extend this class directly.

Location: core/customizer/base.php

It sets up the following elements you can define in your option arrays.

type

Defines the type of control.

Available types are nearly identical to those available to you via input(), but with a layers prefix. Reference.

  • layers-button
  • layers-checkbox
  • layers-button
  • layers-checkbox
  • layers-code
  • layers-color
  • layers-css
  • layers-font
  • layers-heading
  • layers-number
  • layers-range
  • layers-rte
  • layers-select-icons
  • layers-select-images
  • layers-select
  • layers-seperator
  • layers-text
  • layers-textarea

label

The title. This should use l10n:

placeholder

Used in combination with a type of text , textarea , rte  or code  element, and sets some default text inside the field to use an example or instructions.

description

Long-form text describing what your control is used for (optional). Descriptions should be formatted with sprintf and use l10n

class

Used to apply a special CSS class to the control

See Developer Tutorials: Adding Customizer Sections and Controls for a detailed overview of using these in you themes or extensions.