Those are javascript templates that get compiled into HTML by a javascript library. I think WP uses underscore.js.
Let’s say you write a jQuery plugin, and you have to append HTML code to the document. Using such templates you can avoid stuffing that HTML code inside huge concatenated strings within your javascript code, and put it where the other HTML markup is. So you load that template from your plugin, compile it (variables get replaced) and append the resulting HTML to your document. Essentially you separate the business logic from the presentation logic. This also makes your plugin more decoupled.
Related Posts:
- Change Password Hint
- Best way to extends core classes in theme?
- Question about the template-loader.php file
- How does WP detect format type (and can I make use of this)?
- How to start a script from cli within wordpress
- Remove annoying WP Adminbar CSS
- How do I implement a .diff changeset from core.trac.wordpress.org locally?
- Huge debug.log because of “undefined offset in media.php”
- Are all hooks/functions tied to Kses meant for sanitization?
- Location of core code for database connection and get_header
- Admin submenu issue with PHP not detecting two strings as equal
- Usage of var keyword in the core
- Use wp_head hook on template page
- Load WordPress core but with specific plugins
- Custom WordPress Core upgrade through wp-cli
- How can precision be improved for the debug log timestamp?
- change div text and link for logged in users
- How can I send an email using PHP?
- Does My Child-Theme Functions.php Need if{die} Security In It? [duplicate]
- is it possible to run some php code within a wordpress page?
- Remove option to allow trackbacks/pingbacks from post page options
- How to get Woocommerce Variation ID? [closed]
- Geocoding an Exploded Custom Field Array
- Trigger Woocommerce New User Email
- get_users(…) only returns one user
- get_page_by_title with an apostrophe in variable
- Add a Second Menu to a theme that only support 1 menu
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- Include a PHP file inside an array
- Deprecated: Function create_function() is deprecated [closed]
- displaying content that includes shortcodes within an echo
- Update a buggy installation
- trouble with page_id & highlighting current page
- Advice on creating a WP Archive Template with Custom Taxonomy (get_term_meta)
- create front-end users post list by specific category
- wrap a span tag around author’s post count
- Foreach implode issue
- Error display post thumbnails for previous and next post
- get different meta-data of a complicated query at the same time
- Please help! I have a problem with getting wordpress databas
- Get only relevant sub-category of category “Genre” that applies to current product only
- How to escape echo for input tag?
- 400 bad request admin-ajax file upload
- Custom Loop.php having a loop inside a loop
- Warning: count(): syntax problem of the count () function
- Reload page with a different shortcode when a user selects from a dropdown
- Woocommerce Add custom “Add to cart button” in single page with tags
- Displaying child taxonomy before parent
- How do I fetch a data from an external database into my wordpress homepage
- Different home page for logged off users
- Widget Update problems using a for loop
- Send data from plugin to external database
- WP Admin Bar – Get current theme name as custom menu title
- Show custom default avatar instead of gravatar
- the_post_thumbnail unless video id is added
- ajax form function error
- New to WordPress & Freelancing [closed]
- Add a “Next Post” & “Previous Post” styled button manually to a post
- How to store the_post_thumbnail() value in a variable
- Why can’t I enter the wordpress admin interface?
- Show div only if product has attribute
- Create guest author page via php
- hello can you advise how to fix the error?
- How to hide header and footer from page template
- 404 after removing “category” base in wordpress
- Is there a way to get wp_editor (tinymce) content?
- Exclude Everywhere but Admin Area?
- Use URL query string in img src attribute
- Getting a specific “title for a section” only on Startpage?
- Frontend redirect after delete post in wordpress
- ACF Image Alt Tags not loading WordPress library meta’s alt tag
- Change date/time format in custom plugin
- Displaying custom meta box value in a custom post page
- How to pull the current user’s email and insert into a script placeholder?
- Sorting a custom post type in pre_get_posts
- I have an error WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version
- How do you create a front end form that enables the editing of member-specific custom fields in WordPress?
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- How to make multiple custom taxonomies sit under custom post type slug?
- In WordPress how do you remove render-blocking CSS manually without a plugin?
- how to check elementor is widget is active or loaded
- ask about add_rewrite_endpoint query_vars
- PHP – Having $_SESSION as an array and adding $_SESSION to array
- SQL query to retrieve the number of WordPress posts with all given categories
- Saving meta box data from selected option’s value in database is not working
- Create a custom plugin with dynamic child pages listing database records
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- I can’t log into my website , it says “Error: Cookies are blocked due to unexpected output”
- Styling best practices for single pages/templates
- Link on post title only if post have content
- if get_post_meta do something
- How to save a post to a Custom post type and copy the information to another Custom post type?
- Save_Post change Custom Post Type Post title to post id number
- Sidebars panel in customizer
- WordPress If else statement to hide or show a div based on population a field
- Ajax infinite scroll random order shows duplicate posts on custom post type
- RTL in WordPress or Elementor editor
- Bulk data save in custom table
- WordPress @include( ‘template-config.php’ );
- Is there a hook that I can use when a fatal error occurs?