[wp-hackers] best way to check for bootstrap

Chris McCoy chris at lod.com
Wed Feb 26 19:01:30 UTC 2014


Reason I ask, is my plugin makes gravityforms into bootstrap, and I don’t
want to load the bootstrap css and js if its already loaded.

I know I could add an admin_notices saying bootstrap css/js required, etc.



On 2014-02-26, 1:59 PM, "Madalin Ignisca" <madalin.ignisca at gmail.com>
wrote:

>Bootstrap from getbootstrap.com is a frontend framework that should be
>available normally only on theme level.
>
>If you're building a theme with Bootstrap, you should not worry that it
>would be loaded by something else as it should not (if you find a plugin
>that does it, well, the plugin author doesn't likes some good practices
>and
>standards).
>
>The theme is the presentation layer and the top layer of WordPress and
>only
>it should handle this kinds of libraries.
>
>It shouldn't be included in the core as there are dozens of alternatives
>and Bootstrap isn't a standard, it's just popular; there are others better
>done with more features then Bootstrap (well, maybe just my opinion).
>
>
>On Wed, Feb 26, 2014 at 8:52 PM, Nikola Nikolov
><nikolov.tmw at gmail.com>wrote:
>
>> The best approach in my opinion is to use "bootstrap" as it's handle in
>> wp_register/enqueue_style - after all you shouldn't really need
>>different
>> version of bootstrap(or multiple instance of bootstrap) on the same
>>page.
>>
>> Of course you can probably hook late to wp_enqueue_scripts and go
>>through
>> all of the enqueued styles and see if there's anything that contains
>> bootstrap. Obviously that's an overkill and will not always work.
>>
>>
>> On Wed, Feb 26, 2014 at 8:31 PM, Chris McCoy <chris at lod.com> wrote:
>>
>> > What would be the best way to check if bootstrap is added (enqueue)
>>so I
>> > don¹t load it twice.
>> >
>> > Also any plans on adding bootstrap to core shipped scripts?
>> >
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > wp-hackers mailing list
>> > wp-hackers at lists.automattic.com
>> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> >
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>
>
>
>-- 
>*Madalin Ignisca*
>*web developer*
>http://imadalin.ro/
>_______________________________________________
>wp-hackers mailing list
>wp-hackers at lists.automattic.com
>http://lists.automattic.com/mailman/listinfo/wp-hackers




More information about the wp-hackers mailing list