Please register scripts only on your own page
-
You’re correctly only loading the scripts on your own admin pages, but you’re registering
datatables
globally on all admin pages. This is leading to a plugin conflict with my AAA Option Optimizer plugin, which also uses datatables.
The fix is very simple. Change this in the fileclass-ahrefs-seo-view.php
:$this->register_scripts();
if ( $screen instanceof \WP_Screen && in_array( $screen->id, $this->admin_screens, true ) ) {
do_action( 'ahrefs_seo_process_data_' . $screen->id );
$this->add_scripts();
}
so thatregister_scripts
is called inside theif
statement, and you’re done. I couldn’t find a GitHub for your plugin otherwise I’d have done a pull request ??
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Please register scripts only on your own page’ is closed to new replies.