WordPress Customizer JS API not working

I have been getting myself familiar with Customizer JS API but it is proving to be a big headache. I am trying to run a simple piece of code to hide a control –

(function() {
wp.customize.bind( ‘ready’, function() {
var api = this;
this.control( ‘my_control_id’).deactivate();
})( jQuery );

But even this small piece of code is not working. When I refresh the customizer, the control hides for a fraction of a second after being visible again. The JS file has been enqueued properly in customize_controls_enqueue_scripts.
Am I missing something here?

Read more here:: WordPress Customizer JS API not working

Leave a Reply

Your email address will not be published. Required fields are marked *