I am creating a shortcode plugin for Bootstrap framework that will go along with my theme. However since this would be released to the plugin, if a users's theme already has Bootstrap.css included, is there a way for me to check this from a plugin?
You might be able to use
This comes with all the same caveats as @Milo's solution -- it'll only work if the copy of bootstrap.css was registered or enqueued with a handle of
There's no bulletproof way of doing this, as a theme developer could add the
You could check the
Here's a quick example of peeking into the enqueued styles:
Probably the best option, in my opinion, is to do some cursory checking and inform the user that you may have detected bootstrap in their theme, enqueue the file by default, and provide an option to disable the stylesheet.