Title: customize_register
Published: April 25, 2014
Last modified: August 20, 2026

---

# do_action( ‘customize_register’, WP_Customize_Manager $manager )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#wp--skip-link--target)

Fires once WordPress has loaded, allowing scripts and styles to be initialized.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#parameters)󠁿

 `$manager`[WP_Customize_Manager](https://developer.wordpress.org/reference/classes/wp_customize_manager/)

[WP_Customize_Manager](https://developer.wordpress.org/reference/classes/wp_customize_manager/)
instance.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#more-information)󠁿

The ‘customize_register‘ action hook is used to customize and manipulate the Theme
Customization admin screen introduced in WordPress [Version 3.4](https://wordpress.org/support/wordpress-version/version-3-4/).
This hook is a component of the [Theme Customization API](https://developer.wordpress.org/themes/customize-api/).

This hook gives you access to the $wp_customize object, which is an instance of 
the [WP_Customize_Manager](https://developer.wordpress.org/reference/classes/wp_customize_manager/)
class. It is this class object that controls the Theme Customizer screen.

Generally, there are only 4 methods of the $wp_customize object that you will need
to interact with inside the customize_register hook.

  [WP_Customize_Manager->add_setting()](https://developer.wordpress.org/reference/classes/wp_customize_manager/add_setting/)
_This adds a new setting to the database._ [WP_Customize_Manager->add_section()](https://developer.wordpress.org/reference/classes/wp_customize_manager/add_section/)
This adds a new _section_ (i.e. category/group) to the Theme Customizer page. [WP_Customize_Manager->add_control()](https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/)
This creates an HTML control that admins can use to change settings. This is also
where you choose a section for the control to appear in. [WP_Customize_Manager->get_setting()](https://developer.wordpress.org/reference/classes/wp_customize_manager/get_setting/)
This can be used to fetch any existing setting, in the event you need to modify 
something (like one of WordPress’s default settings).

**Example: Customizer with basic controls sample**

    ```php
    function themename_customize_register($wp_customize){

    $wp_customize->add_section('themename_color_scheme', array(
    'title'    => __('Color Scheme', 'themename'),
    'description' => '',
    'priority' => 120,
    ));

    //  =============================
    //  = Text Input                =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[text_test]', array(
    'default'        => 'value_xyz',
    'capability'     => 'edit_theme_options',
    'type'           => 'option',

    ));

    $wp_customize->add_control('themename_text_test', array(
    'label'      => __('Text Test', 'themename'),
    'section'    => 'themename_color_scheme',
    'settings'   => 'themename_theme_options[text_test]',
    ));

    //  =============================
    //  = Radio Input               =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[color_scheme]', array(
    'default'        => 'value2',
    'capability'     => 'edit_theme_options',
    'type'           => 'option',
    ));

    $wp_customize->add_control('themename_color_scheme', array(
    'label'      => __('Color Scheme', 'themename'),
    'section'    => 'themename_color_scheme',
    'settings'   => 'themename_theme_options[color_scheme]',
    'type'       => 'radio',
    'choices'    => array(
    'value1' => 'Choice 1',
    'value2' => 'Choice 2',
    'value3' => 'Choice 3',
    ),
    ));

    //  =============================
    //  = Checkbox                  =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[checkbox_test]', array(
    'capability' => 'edit_theme_options',
    'type'       => 'option',
    ));

    $wp_customize->add_control('display_header_text', array(
    'settings' => 'themename_theme_options[checkbox_test]',
    'label'    => __('Display Header Text'),
    'section'  => 'themename_color_scheme',
    'type'     => 'checkbox',
    ));

    //  =============================
    //  = Select Box                =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[header_select]', array(
    'default'        => 'value2',
    'capability'     => 'edit_theme_options',
    'type'           => 'option',

    ));
    $wp_customize->add_control( 'example_select_box', array(
    'settings' => 'themename_theme_options[header_select]',
    'label'   => 'Select Something:',
    'section' => 'themename_color_scheme',
    'type'    => 'select',
    'choices'    => array(
    'value1' => 'Choice 1',
    'value2' => 'Choice 2',
    'value3' => 'Choice 3',
    ),
    ));

    //  =============================
    //  = Image Upload              =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[image_upload_test]', array(
    'default'           => 'image.jpg',
    'capability'        => 'edit_theme_options',
    'type'           => 'option',

    ));

    $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'image_upload_test', array(
    'label'    => __('Image Upload Test', 'themename'),
    'section'  => 'themename_color_scheme',
    'settings' => 'themename_theme_options[image_upload_test]',
    )));

    //  =============================
    //  = File Upload               =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[upload_test]', array(
    'default'           => 'arse',
    'capability'        => 'edit_theme_options',
    'type'           => 'option',

    ));

    $wp_customize->add_control( new WP_Customize_Upload_Control($wp_customize, 'upload_test', array(
    'label'    => __('Upload Test', 'themename'),
    'section'  => 'themename_color_scheme',
    'settings' => 'themename_theme_options[upload_test]',
    )));

    //  =============================
    //  = Color Picker              =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[link_color]', array(
    'default'           => '#000',
    'sanitize_callback' => 'sanitize_hex_color',
    'capability'        => 'edit_theme_options',
    'type'           => 'option',

    ));

    $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_color', array(
    'label'    => __('Link Color', 'themename'),
    'section'  => 'themename_color_scheme',
    'settings' => 'themename_theme_options[link_color]',
    )));

    //  =============================
    //  = Page Dropdown             =
    //  =============================
    $wp_customize->add_setting('themename_theme_options[page_test]', array(
    'capability'     => 'edit_theme_options',
    'type'           => 'option',

    ));

    $wp_customize->add_control('themename_page_test', array(
    'label'      => __('Page Test', 'themename'),
    'section'    => 'themename_color_scheme',
    'type'    => 'dropdown-pages',
    'settings'   => 'themename_theme_options[page_test]',
    ));

    // =====================
    //  = Category Dropdown =
    //  =====================
    $categories = get_categories();
    $cats = array();
    $i = 0;
    foreach($categories as $category){
    if($i==0){
    $default = $category->slug;
    $i++;
    }
    $cats[$category->slug] = $category->name;
    }

    $wp_customize->add_setting('_s_f_slide_cat', array(
    'default'        => $default
    ));
    $wp_customize->add_control( 'cat_select_box', array(
    'settings' => '_s_f_slide_cat',
    'label'   => 'Select Category:',
    'section'  => '_s_f_home_slider',
    'type'    => 'select',
    'choices' => $cats,
    ));
    }

    add_action('customize_register', 'themename_customize_register');
    ```

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#source)󠁿

    ```php
    do_action( 'customize_register', $this );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-manager.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-customize-manager.php#L948)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-customize-manager.php#L948-L948)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#related)󠁿

| Used by | Description | 
| [_wp_customize_publish_changeset()](https://developer.wordpress.org/reference/functions/_wp_customize_publish_changeset/)`wp-includes/theme.php` |

Publishes a snapshot’s changes.

  | 
| [WP_Customize_Manager::wp_loaded()](https://developer.wordpress.org/reference/classes/wp_customize_manager/wp_loaded/)`wp-includes/class-wp-customize-manager.php` |

Registers styles/scripts and initialize the preview of each setting

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 4 content](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#comment-content-5601)
 2.    [thejaydip](https://profiles.wordpress.org/iamjaydip/)  [  5 years ago  ](https://developer.wordpress.org/reference/hooks/customize_register/#comment-5601)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%23comment-5601)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%23comment-5601)
 4.  **Please see the below code to remove the section of colors.**
 5.      ```php
         function wpdocs_deregister_section( $wp_customize ) {
     
         	$wp_customize->remove_section( 'colors' );
         }
         add_action( 'customize_register', 'wpdocs_deregister_section', 999 );
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%3Freplytocom%3D5601%23feedback-editor-5601)
 7.   [Skip to note 5 content](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#comment-content-6395)
 8.    [brandonjp](https://profiles.wordpress.org/brandonjp/)  [  4 years ago  ](https://developer.wordpress.org/reference/hooks/customize_register/#comment-6395)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%23comment-6395)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%23comment-6395)
 10. The “Customize” link will usually disappear if you’re using a modern Block Theme
     or Full Site Editing theme. You can add it back by returning true to `customize_register`.
     This can be useful if you’re trying to edit the WooCommerce Store Notice or if
     you’re using another plugin that places settings in the Customizer.
 11.     ```php
         add_action( 'customize_register', '__return_true' );
         ```
     
 12.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%3Freplytocom%3D6395%23feedback-editor-6395)
 13.  [Skip to note 6 content](https://developer.wordpress.org/reference/hooks/customize_register/?output_format=md#comment-content-6972)
 14.   [Matt Lowe](https://profiles.wordpress.org/squelch/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/customize_register/#comment-6972)
 15. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%23comment-6972)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%23comment-6972)
 16. Don’t conditionally hook `customize_register` behind an `is_admin()` check. e.
     g.
 17.     ```php
         // Incorrect:
         if ( is_admin() ) {
             add_action( 'customize_register', 'add_customizer_sections' );
         }
         ```
     
 18. Doing so will cause your custom sections to disappear from the Customizer.
 19.     ```php
         // Correct:
         add_action( 'customize_register', 'add_customizer_sections' );
         ```
     
 20.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F%3Freplytocom%3D6972%23feedback-editor-6972)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fcustomize_register%2F)
before being able to contribute a note or feedback.