Customizer: Add _wp_attachment_is_custom_background meta to uploaded background images.

Adds `$type` property to `WP_Customize_Background_Image_Control` (PHP) and introduces `wp.customize.BackgroundControl` (JS).

see #30707.
Built from https://develop.svn.wordpress.org/trunk@30885


git-svn-id: http://core.svn.wordpress.org/trunk@30873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling
2014-12-15 23:28:23 +00:00
parent 824d751879
commit fcb00b75e2
9 changed files with 123 additions and 8 deletions

View File

@@ -879,6 +879,7 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
* @since 3.4.0
*/
class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {
public $type = 'background';
/**
* Constructor.
@@ -894,6 +895,21 @@ class WP_Customize_Background_Image_Control extends WP_Customize_Image_Control {
'section' => 'background_image',
) );
}
/**
* Enqueue control related scripts/styles.
*
* @since 4.1.0
*/
public function enqueue() {
parent::enqueue();
wp_localize_script( 'customize-controls', '_wpCustomizeBackground', array(
'nonces' => array(
'add' => wp_create_nonce( 'background-add' ),
),
) );
}
}
class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
@@ -912,7 +928,6 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
'data' => 'header_image_data',
),
'section' => 'header_image',
'context' => 'custom-header',
'removed' => 'remove-header',
'get_url' => 'get_header_image',
) );