I'm using the plugin 'Ninja From' and I'm trying to stop it from loading a CSS file in the header.
The code that shows up when the wp_head()
is called:
<link rel='stylesheet' id='nf-display-css' href='http://example.com/wp-content/plugins/ninja-forms/assets/css/display-structure.css?ver=4.7.1' type='text/css' media='all' />
My code:
function remove_css_ninja_form(){
wp_dequeue_style('nf-display-css');
wp_deregister_style('nf-display-css');
wp_dequeue_style('nf-display');
wp_deregister_style('nf-display');
}
add_action( 'wp_enqueue_scripts', 'remove_css_ninja_form', 99999 );
add_action( 'wp_print_styles', 'remove_css_ninja_form', 99999 );
add_action( 'wp_head', 'remove_css_ninja_form', 9999 );
It is not working.
The PHP code from the plugin that's loading the CSS file:
wp_enqueue_style( 'nf-display', $css_dir . 'display-structure.css', array( 'dashicons' ) );