After experimenting somewhat, I have found the following:
The only way I can seem to entirely remove all remaining CSS Files, is by removing the following code from /wp-content/plugins/ml-slider/inc/slider/metaslider.class.css
:
public function enqueue_scripts() {
if ('true' == $this->get_setting('printJs')) {
$handle = 'metaslider-' . $this->get_setting('type') . '-slider';
wp_enqueue_script($handle, METASLIDER_ASSETS_URL . $this->js_path, array('jquery'), METASLIDER_VERSION);
$this->wp_add_inline_script($handle, $this->get_inline_javascript());
}
if ( $this->get_setting( 'printCss' ) == 'true' ) {
// this will be added to the bottom of the page as <head> has already been processed by WordPress.
// For HTML5 compatibility, use a minification plugin to move the CSS to the <head>
wp_enqueue_style( 'metaslider-' . $this->get_setting( 'type' ) . '-slider', METASLIDER_ASSETS_URL . $this->css_path, false, METASLIDER_VERSION );
wp_enqueue_style( 'metaslider-public', METASLIDER_ASSETS_URL . 'metaslider/public.css', false, METASLIDER_VERSION );
}
do_action( 'metaslider_register_public_styles' );
}
By removing the above code, in its entirety, it also removes the .js
files. Something I do not wish to do. Adopting the ‘method of elimination’ approach, to find out which code snippet was responsible for the CSS Files, I solely removed:
if ('true' == $this->get_setting('printJs')) {
$handle = 'metaslider-' . $this->get_setting('type') . '-slider';
wp_enqueue_script($handle, METASLIDER_ASSETS_URL . $this->js_path, array('jquery'), METASLIDER_VERSION);
$this->wp_add_inline_script($handle, $this->get_inline_javascript());
}
This did not remove anything.
I then solely removed:
if ( $this->get_setting( 'printCss' ) == 'true' ) {
// this will be added to the bottom of the page as <head> has already been processed by WordPress.
// For HTML5 compatibility, use a minification plugin to move the CSS to the <head>
wp_enqueue_style( 'metaslider-' . $this->get_setting( 'type' ) . '-slider', METASLIDER_ASSETS_URL . $this->css_path, false, METASLIDER_VERSION );
wp_enqueue_style( 'metaslider-public', METASLIDER_ASSETS_URL . 'metaslider/public.css', false, METASLIDER_VERSION );
}
Upon removing the above snippet, all remaining CSS Files were removed apart from:
/wp-content/plugins/ml-slider/assets/sliders/nivoslider/themes/default/default.css?ver=3.10.3
Any ideas on how to resolve this matter? Once the relevant code snippet has been identified, what would be the best approach to remove dequeue the snipper within the functions.php
file? I have tried many approaches but cannot seem to remove the remaining CSS Files.