Theme Customizer: For clarity, wp.customize.Setting.method to wp.customize.Setting.transport. Add WP_Customize_Setting->transport to allow setting the transport method via PHP. see #19910.

git-svn-id: https://develop.svn.wordpress.org/trunk@20585 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-04-25 16:04:51 +00:00
parent 9c6a0682cc
commit dfd80ddc57
4 changed files with 8 additions and 9 deletions
+4 -8
View File
@@ -4,7 +4,7 @@
/*
* @param options
* - previewer - The Previewer instance to sync with.
* - method - The method to use for previewing. Supports 'refresh' and 'postMessage'.
* - transport - The transport to use for previewing. Supports 'refresh' and 'postMessage'.
*/
api.Setting = api.Value.extend({
initialize: function( id, value, options ) {
@@ -13,7 +13,7 @@
api.Value.prototype.initialize.call( this, value, options );
this.id = id;
this.method = this.method || 'refresh';
this.transport = this.transport || 'refresh';
element = $( '<input />', {
type: 'hidden',
@@ -28,7 +28,7 @@
this.bind( this.preview );
},
preview: function() {
switch ( this.method ) {
switch ( this.transport ) {
case 'refresh':
return this.previewer.refresh();
case 'postMessage':
@@ -403,6 +403,7 @@
$.each( api.settings.settings, function( id, data ) {
api.set( id, id, data.value, {
transport: data.transport,
previewer: previewer
} );
});
@@ -434,11 +435,6 @@
event.preventDefault();
});
// Background color uses postMessage by default
api( 'background_color', function( setting ) {
setting.method = 'postMessage';
});
// Control visibility for default controls
$.each({
'background_image': {