Title: WP_Customize_Background_Image_Control::enqueue
Published: December 18, 2014
Last modified: February 24, 2026

---

# WP_Customize_Background_Image_Control::enqueue()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_background_image_control/enqueue/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_background_image_control/enqueue/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_background_image_control/enqueue/?output_format=md#changelog)

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

Enqueue control related scripts/styles.

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

    ```php
    public function enqueue() {
    	parent::enqueue();

    	$custom_background = get_theme_support( 'custom-background' );
    	wp_localize_script(
    		'customize-controls',
    		'_wpCustomizeBackground',
    		array(
    			'defaults' => ! empty( $custom_background[0] ) ? $custom_background[0] : array(),
    			'nonces'   => array(
    				'add' => wp_create_nonce( 'background-add' ),
    			),
    		)
    	);
    }
    ```

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

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

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

Gets the theme support arguments passed when registering that support.

  | 
| [wp_localize_script()](https://developer.wordpress.org/reference/functions/wp_localize_script/)`wp-includes/functions.wp-scripts.php` |

Localizes a script.

  | 
| [wp_create_nonce()](https://developer.wordpress.org/reference/functions/wp_create_nonce/)`wp-includes/pluggable.php` |

Creates a cryptographic token tied to a specific action, user, user session, and window of time.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/wp_customize_background_image_control/enqueue/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_customize_background_image_control/enqueue/?output_format=md#)

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

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

## User Contributed Notes

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