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
|
// 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', function( control ) {
|
||||||
api('background_image').uploader.param( 'post_data[context]', 'custom-background' );
|
control.uploader.param( 'post_data[context]', 'custom-background' );
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
})( wp, jQuery );
|
})( wp, jQuery );
|
|
@ -68,8 +68,10 @@
|
||||||
|
|
||||||
body = $(document.body);
|
body = $(document.body);
|
||||||
// Auto update background color by default
|
// Auto update background color by default
|
||||||
api.bind( 'background_color', function( to ) {
|
api( 'background_color', function( value ) {
|
||||||
body.css( 'background-color', '#' + to );
|
value.bind( function( to ) {
|
||||||
|
body.css( 'background-color', '#' + to );
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue