None of the JavaScript works when using wp_editor
None of the JavaScript works when using wp_editor
None of the JavaScript works when using wp_editor
Just chuck them in a file, say your-theme/js/global.js and enqueue it in functions.php: function wpse_180397_scripts() { wp_enqueue_script( ‘wpse-180397-global’, /* Unique ID */ get_bloginfo( ‘template_url’ ) . ‘/js/global.js’, /* URL */ array(), /* Dependencies */ true /* In footer */ ); } add_action( ‘wp_enqueue_scripts’, ‘wpse_180397_scripts’ );
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
WordPress 4.2 mce-views migration guide?
$(‘.follow-links a’).toggle(); should be $this.toggle();.
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
Editing the source of a display for posts (to category recent)
Check .htaccess file if it is blocking with this rule: #add_header Content-Security-Policy “default-src ‘self’;”; https://wordpress.org/support/topic/no-visual-edition-is-showing/
Short Answer: Yes, but… Just make sure your call to wp enqueue script is before the call to get_header(). The problem is that when you’re in a later part of your template the header including the script is already sent to the browser so you can’t change it any more. While this is possible I’d … Read more
how to include js in widget?