Accessing customizer values in javascript
Given a setting with an ID of “foo” you can obtain the value via: var value = wp.customize( ‘foo’ ).get() To ensure that the setting is registered before you attempt to get its value, you can use this deferred pattern: wp.customize( ‘foo’, function( setting ) { var value = setting.get(); // … }); This should … Read more