How to use the underscore.js templates in WordPress?
WordPress 4.5 is released with lot of new updates, but our clients pointed out that some of shortcodes from our Awesome Easy Bootstrap Shortcode stop working such as Tabs, Accordion etc.
This happened due to the latest update to core undescore.js file from 1.7 to 1.8.3. and as per the new update
Underscore templates no longer accept an initial data object. _.template always returns a function now.
This means that we can’t use the following code
var item = _.template(<template_name>, <data-object>);
We have to use this code
var item = _.template(<template_name>); item = item(<data-object>);
So this is the way to use underscore templates in the latest underscore.js
Basic Elements
Interactive
Content
Miscellaneous
Social
Search
Accordion
Animation Shortcode
Badge
Blur
Boxframe
Button
Button Group
Columns
Description List
Dropcap
Google Map
Highlights
Horizontal Rule
Image Effects
Label
Lead
List
Notifications
Page Header
Panel
Popover
Pricing Table
Progress Bar
Section Heading
Separator
Servicebox
Tables
Tabs
Testimonial
Video
Well
Widget