Closed bostondv closed 10 years ago
They are added as those two components require trigger functions.
On 6 Aug 2014, at 21:54, Boston Dell-Vandenberg notifications@github.com wrote:
There are two javascript assets from the plugin that are being loaded into the wp_footer on the front-end. includes/js/bootstrap-shortcodes-popover.js and includes/js/bootstrap-shortcodes-tooltip.js.
Since the plugin depends on Bootstrap being included in the theme, why do we need to load additional scripts and add these two http requests?
Or looking at the code... I wonder if these are meant for the wp-admin? If so, I think you should be loading them with admin_enqueue_scripts so they aren't loaded in the front-end.
Thanks for the great plugin!
— Reply to this email directly or view it on GitHub.
Thanks for pointing out the discussion, admittedly I didn't search through the issues before posting. Anyways, I see where you're coming from now.
Loading the scripts only when the associated shortcodes are used would be a nice addition that was discussed in the other thread.
Additionally, what about adding a filter to control whether the the scripts are loaded? This way a developer could disable the script loading in the case they don't need the two components or wish to initialize them within their own javascript files. — Boston
On Wed, Aug 6, 2014 at 8:54 PM, MWDelaney notifications@github.com wrote:
Closed #89.
Reply to this email directly or view it on GitHub: https://github.com/filipstefansson/bootstrap-3-shortcodes/issues/89#event-150042366
These scripts should now be conditionally loaded only when the [tooltip] and [popover] shortcodes are in use on a given page. See here: c1131e00b13176947caeb0fbb4286a0605c2c68a
There are two javascript assets from the plugin that are being loaded into the wp_footer on the front-end.
includes/js/bootstrap-shortcodes-popover.js
andincludes/js/bootstrap-shortcodes-tooltip.js
.Since the plugin depends on Bootstrap being included in the theme, why do we need to load additional scripts and add these two http requests?
Or looking at the code... I wonder if these are meant for the wp-admin? If so, I think you should be loading them with
admin_enqueue_scripts
so they aren't loaded in the front-end.Thanks for the great plugin!