mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 23:25:50 +01:00
Theme Customizer: Ensure background_color and background_image exist instead of blindly attempting to access their controls. see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
452da8fccc
commit
7a794b8941
@ -249,10 +249,13 @@
|
||||
});
|
||||
|
||||
// Background color uses postMessage by default
|
||||
api('background_color').method = 'postMessage';
|
||||
api( 'background_color', function( control ) {
|
||||
control.method = 'postMessage';
|
||||
});
|
||||
|
||||
// api('background_image').method = 'postMessage';
|
||||
api('background_image').uploader.param( 'post_data[context]', 'custom-background' );
|
||||
api( 'background_image', function( control ) {
|
||||
control.uploader.param( 'post_data[context]', 'custom-background' );
|
||||
});
|
||||
});
|
||||
|
||||
})( wp, jQuery );
|
@ -68,8 +68,10 @@
|
||||
|
||||
body = $(document.body);
|
||||
// Auto update background color by default
|
||||
api.bind( 'background_color', function( to ) {
|
||||
body.css( 'background-color', '#' + to );
|
||||
api( 'background_color', function( value ) {
|
||||
value.bind( function( to ) {
|
||||
body.css( 'background-color', '#' + to );
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user