Receive “menu-toogle” event from section menu in customizer

So far the only solution I’ve come up with is creating a function that postMessages the event into the iframe (using customize_controls_enqueue_scripts hook). As for the receiver in iframe (hooked on customize_preview_init hook) I think it could still need some optimization because I’m getting a weird issue with window.addEventListener(‘message’,* getting some duplicate on customizer loading.. … Read more

Dequeue set-post-thumbnail.min.js

You should be able to dequeue like normal. Despite the complexity of the function, it is really just enqueueing scripts and styles. Tested with the admin bar script on the front end: add_action( ‘wp_enqueue_scripts’, function() { wp_dequeue_script(‘admin-bar’); } ); You just want admin_enqueue_scripts and set-post-thumbnail: add_action( ‘admin_enqueue_scripts’, function() { wp_dequeue_script(‘set-post-thumbnail’); } ); I am not … Read more

Unserialize WP_Options options programatically?

The get_option and update_option functions in PHP automatically handle serialization/unserialization for you: https://codex.wordpress.org/Function_Reference/get_option If you need to interface with these functions using JavaScript (assuming JavaScript and not Java, as others have pointed out) you could register an AJAX endpoint that calls these functions for you that you can interface with via JavaScript on the front-end: … Read more