[wp-trac] [WordPress Trac] #31320: Make customizer JavaScript API available during the live preview
WordPress Trac
noreply at wordpress.org
Sun Feb 28 03:01:51 UTC 2016
#31320: Make customizer JavaScript API available during the live preview
-------------------------+------------------------------
Reporter: Fab1en | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.1
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: javascript
-------------------------+------------------------------
Comment (by sidati):
Thank you @westonruter very mush,
your code was very helpful and enlighten, but please correct this "typo",
you want to bind the `customize-parent-proxy-response` not `customize-
parent-proxy-command`
{{{#!php
<?php
wp.customize.preview.bind( 'customize-parent-proxy-RESPONSE', function (
commandId, retval ) {
var callback = commandCallbacks[ commandId ];
if ( callback ) {
callback( retval );
delete commandCallbacks[ commandId ];
}
} );
}}}
Also the order of the variables is incorrect and you mis-placed the code,
the code you said is for Previewer is actually for the customiser pane and
vice versa.
Again thanks for taking time to write a such code.
Sidati,
Regards
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31320#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list