js injection in back-end
-
I’ve noticed that the plugin injects its JS on every back-end pages. It should enqueue its scripts only where is needed, to avoid conflicts with other plugins in other areas than the post/page edit screen.
I’ve added a check in your plugin_admin_scripts function, on line 277 of rich-text-excerpt.php, like this:
public static function plugin_admin_scripts() { $screen = get_current_screen(); if ( $screen->base == 'post' ) wp_enqueue_script('RichTextExcerptsAdminScript', plugins_url('rich-text-excerpts.js', __FILE__), array('jquery')); }
and it seems to work well.
Hope it can be useful
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘js injection in back-end’ is closed to new replies.