I'm trying to dequeue the font-awesome stylesheet included with the ninja forms plugin (because I manually include the latest FA via a CDN).

I did this:

add_action('wp_enqueue_scripts', function () {
}, 100);

However the version included in the plugin still loads.

So, how do I dequeue a script or stylesheet at the very last moment? I'm obviously not dequeing "late enough", and that's why the above isn't working.

What is "later" than wp_enqueue_scripts?


I used this to determine which actions were firing, and their order:

add_action( 'shutdown', function(){
    foreach( $GLOBALS['wp_actions'] as $action => $count )
        printf( '%s (%d) <br/>' . PHP_EOL, $action, $count );


And that showed me that the ninja forms plugin uses a custom action nf_display_enqueue_scripts, which is what I used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.