Javavscript conflict
-
the gutenberg.min.js is causing a javascript conflict with ajax elsewhere on my site.
There is a simple fix, only enqueue it where it is needed, ie in the editor. I have done so by changing plugin.php around 291 thus:
$screen = get_current_screen();
if ( $screen->parent_base == ‘edit’ ) {
// Gutenberg.
wp_enqueue_script( ‘plt-gutenberg’, $this->get_url() . ‘js/gutenberg.min.js’, array( ‘wp-edit-post’, ‘wp-element’, ‘wp-plugins’ ), self::CSS_JS_VERSION, true );}
This is probaby god practice anyway, although I am sure there is a better way to do it than I have. Can this change be added to the core plugin?
Pete
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Javavscript conflict’ is closed to new replies.