Your JS link in cleanup-html.php on line 56 is relying on the wordpress function is_admin. For builders, that doesn’t come back as true because the URL isn’t wp-admin. I have changed it for my needs and it seems to work both in the backend editor and in AVADA live builder.
I removed :
// Insertion scripts
function cleanup_html_admin_scripts() {
wp_register_script('cleanup_html_admin_scripts', plugin_url() . '/cleanup-html.js');
wp_enqueue_script('cleanup_html_admin_scripts');
}
if (is_admin()) {
add_action('init', 'cleanup_html_admin_scripts');
}
and added …
add_action( 'after_wp_tiny_mce', 'custom_after_wp_tiny_mce' );
function custom_after_wp_tiny_mce() {
printf( '<script type="text/javascript" src="%s"></script>', plugins_url('/cleanup-html.js', __FILE__) );
}
This then should load whenever the TinyMce editor is loaded.
]]>I have accidentally copied scripts from the old site to the new one (details here) and I want to clean it up with the use of this plugin. I tried it but it did not remove the scripts.
Can this be done with this plugin?
thanks!
]]>Line 58, is missing quotes around the function name.
add_action('init', 'cleanup_html_admin_scripts');