Enqueue the script only on editor pages
-
Hi, great utility, thanks!
Right now, the plugin prints its script on all admin pages. You can enqueue it only withing Gutenberg context with this:
add_action( 'enqueue_block_editor_assets', function () { $script = "jQuery( window ).load( function() { /* script */ });"; wp_add_inline_script( 'wp-blocks', $script ); });
The topic ‘Enqueue the script only on editor pages’ is closed to new replies.