Title: Customizer Framework
Author: Philip Newcomer
Published: <strong>Agẹmọ  28, 2014</strong>
Last modified: Agẹmọ  28, 2014

---

Ṣàwárí àwọn plugin

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

![](https://s.w.org/plugins/geopattern-icon/customizer-framework.svg)

# Customizer Framework

 Láti ọwọ́ [Philip Newcomer](https://profiles.wordpress.org/philipnewcomer/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/customizer-framework.0.1.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/customizer-framework/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/customizer-framework/#reviews)
 *  [Ìgbéwọlẹ̀](https://yor.wordpress.org/plugins/customizer-framework/#installation)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/customizer-framework/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/customizer-framework/)

## Àpèjúwe

A lightweight and easy-to-use framework for the WordPress Customizer. Provides a
simple and intuitive API for registering Customizer settings, including advanced
control types. Automatically sanitizes settings based on the control type. Eliminates
the tedious task of registering a setting, control, and sanitization function for
each individual Customizer setting.

The framework may be used by both plugins and themes, although since at this time
the settings are saved as theme mods, any plugin settings will be specific to the
active theme. Support for option type settings is planned.

_This plugin is currently in beta, and may be subject to major changes as it matures._

#### Issues and Support

Contribute to the project [on GitHub](https://github.com/philipnewcomer/Customizer-Framework).

#### Why a Framework for the Customizer?

The recent WordPress Customizer API suffers from some of the same issues afflicting
the old Settings API. The Settings API was overcomplicated, unintuitive, and confusing.
The result was a crop of theme option frameworks that have sprung up to make it 
easier for developers to create theme options. The Customizer API is a bit better,
but itÌtumọ̀ Yorùbá: ’s still more complicated than necessary, and registering Customizer
settings is still a convoluted mess of settings functions, controls functions, and
sanitization functions. Now, the ease of use which the theme option frameworks have
provided for the Settings API is available for the Customizer, in the Customizer
Framework plugin.

The Customizer Framework aims to be a lightweight wrapper around the convoluted 
Customizer API, which makes it fun to be a WordPress developer again. Developers
can now focus their time on creating great themes that utilize the Customizer, not
on writing 500 lines of code in order to create 10 Customizer settings. Okay, so
I might be exaggerating a bit. But not by much. Do you really want to spend your
time registering a Customizer setting, then registering a control for that setting,
and then writing a sanitization function for that setting? And thatÌtumọ̀ Yorùbá:’
s only for one setting! And then thereÌtumọ̀ Yorùbá: ’s the advanced controls, such
as image or color, that require you to instantiate their own control class, requiring
even more convoluted and unintuitive code. And why should you even have to care 
about the differece between a setting and a control? DonÌtumọ̀ Yorùbá: ’t you have
better things to spend your time on, like creating great WordPress themes? I thought
so.

### Usage

Activate the plugin, or `include` it in your theme.

Before creating any settings, you need to create any new Customizer [sections](https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_section)
that you wish to use. Any custom sections need to exist before you can add settings
to them.

Finally, initialize a new `CustomizerFramework` class, and add your settings:

    ```
    function mytheme_register_settings( $settings ) {

        $settings[] = array(
            'id'      => 'example_setting',
            'label'   => 'Example Setting Label',
            'section' => 'example-section',
            'type'    => 'text', // Optional, defaults to 'text'
            'default' => 'Example section default text', // Optional
        );

    }
    add_filter( 'customizer_framework_settings', 'mytheme_register_settings' );
    ```

#### Setting Types

Here are the currently available setting types:

 * `checkbox`
 * `color`
 * `dropdown-pages`
 * `image`
 * `radio`
 * `select`
 * `text`
 * `textarea` (requires WordPress 4.0)

The `radio` and `select` types require an additional `choices` parameter, containing
an array of the valid choices:

    ```
    'choices' => array(
        'choice_1' => 'Choice 1',
        'choice_2' => 'Choice 2',
        'choice_3' => 'Choice 3',
    ),
    'default' => 'choice_1',
    ```

In addition, on WordPress 4.0, you can specify any additional HTML5 input types,
such as `url` or `date`. You can also include an `atts` parameter, containing an
array of additional input attributes which should be applied to the input:

    ```
    'type' => 'url',
    'atts' => array(
        'placeholder' => 'http://',
        'class'       => 'a-custom-css-class',
    ),
    ```

#### Sanitization

All settings are sanitized automatically, based on the setting type. If you wish
to specify your own sanitization function for a setting, add a `sanitize_cb` parameter,
containing the function name to be called, which should return the sanitized value.

    ```
    'sanitize_cb' => 'my_custom_example_setting_sanitization_function',
    ```

## Ìgbéwọlẹ̀

Install like any other plugin. If youÌtumọ̀ Yorùbá: ’re a theme developer, then 
you already know how to install a plugin, and I wonÌtumọ̀ Yorùbá: ’t bore you with
the details. See [Other Notes](https://wordpress.org/plugins/customizer-framework/other_notes/)
for usage instuctions.

If youÌtumọ̀ Yorùbá: ’re creating a theme for public release, I recommend that you
consider using the [TGM Plugin Activation](http://tgmpluginactivation.com/) library
to make it easy for your users to install the Customizer Framework after activating
your theme.

You could also `include` the plugin it in your theme, but remember to check for 
the existince of the plugin version first to avoid conflicts.

## FAQ

  Q: How do I retrieve the saved settings?

A: The Customizer Framework saves its settings using the [Theme Modification API](https://codex.wordpress.org/Theme_Modification_API),
so you would use [get_theme_mod()](https://codex.wordpress.org/Function_Reference/get_theme_mod)
to retrive the saved value.

## Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

## Àwọn Olùkópa & Olùgbéejáde

“Customizer Framework” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti 
ṣe ìkópa sí plugin yìí.

Àwọn Olùkópa

 *   [ Philip Newcomer ](https://profiles.wordpress.org/philipnewcomer/)

[Túmọ̀ “Customizer Framework” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/customizer-framework)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/customizer-framework/),
ṣàyẹ̀wò [ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/customizer-framework/),
tàbí ṣe àgbékalẹ̀ sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/customizer-framework/)
nípasẹ̀ [RSS](https://plugins.trac.wordpress.org/log/customizer-framework/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

#### 0.1

 * Initial beta release.

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **0.1**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **ọdún 12 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **10+**
 *  Ẹ̀yà WordPress ** 3.4 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **4.0.38**
 *  Èdè
 * [English (US)](https://wordpress.org/plugins/customizer-framework/)
 * Àwọn àmì
 * [customizer](https://yor.wordpress.org/plugins/tags/customizer/)[framework](https://yor.wordpress.org/plugins/tags/framework/)
   [option](https://yor.wordpress.org/plugins/tags/option/)[theme customizer](https://yor.wordpress.org/plugins/tags/theme-customizer/)
   [wrapper](https://yor.wordpress.org/plugins/tags/wrapper/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/customizer-framework/advanced/)

## Àwọn ìbò

Kò sí ìwádìí tí a tíì fi ránṣẹ́.

[Your review](https://wordpress.org/support/plugin/customizer-framework/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/customizer-framework/reviews/)

## Àwọn Olùkópa

 *   [ Philip Newcomer ](https://profiles.wordpress.org/philipnewcomer/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/customizer-framework/)

## Ṣe ìtọrẹ

Ṣé o fẹ́ ṣe àtìlẹ́yìn fún ìlọsíwájú plugin yìí?

 [ Ṣe ìtọrẹ sí plugin yìí ](https://philipnewcomer.net/donate/)