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:
@@ -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',
|
||||
) );
|
||||
|
||||
Reference in New Issue
Block a user