It’s a combination of _e()
, which echoes a translatable string, and esc_html()
which is for outputting text so that the text is not interpreted as HTML.
You would use it to prevent HTML being smuggled into a translation and breaking your markup or causing security issues.
For example, if your theme had:
_e( 'My translatable string', 'my-text-domain' );
Then it’s possible for a translation for 'My translatable string'
to be something like '<script>alert('Bad!');</script>'
. If you don’t use esc_html_e()
then that script will be executed. If you use esc_html_e()
then it won’t be, because the <
& >
characters will be escaped as <
& >
, which out output as < and > and not interpreted as HTML tags.
Related Posts:
- Build a content and excerpt grid loop with paging and options for # of posts
- Displaying post per day
- How to add active class to custom menu using while loop and wp_list_pages
- delete an array element when its date expires
- How can I loop into two different DIVS without repeating the DIVs
- How to speed up a wordpress function with multiple loops?
- Custom excerpt function re-factoring
- Get first URL from post content
- Show css depending on activity type in BuddyPress activity-loop [closed]
- get author_name from queried post
- Blog posts repeat
- how to refresh div on template part?
- Can’t find infinite loop cause
- Checking array against author id in loop
- Custom Pagination is Broken
- Is the 404 page automatically displayed if a loop returns nothing?
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- use loop to return blog details
- How to get current post category details inside “loop”?
- Calling function in loop causes repeat data
- Strip from or something better?
- How to Add a cutsom slug to my custom author role
- Products listing check if meta checkbox is checked
- How to output the taxonomies that are assigned to each custom post?
- update_user_meta as multiple value but with same meta key
- cURL needing to loop through all “next_page”
- WordPress Ajax filter: Create two loops for different output styles?
- How can I get my pagination loop to display the correct number of total pages?
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- How fix error in the WordPress loop?
- My query keeps looping infinitely ! how to stop it?
- Retrieving specific images from Media Library
- Modify category archive page loop on functions.php
- Published custom posts missing
- Pagenav Not appearing on custom Template
- Options.php loop won’t show!
- Loop on a wordpress Page instead of content coming from the WP text editor
- Removing Default Gutenberg Blocks, But Keeping Reusable Block Functionality?
- adding a filter to a shortcode?
- Change the footer text on the login page
- Rewriting search and pagination base
- Copyright info change in Theme Child PHP
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- Post from one loop in different containers?
- Understanding WordPress child theme custom JS loading
- Problem with ACF shortcode with Repeater Field in WordPress? [closed]
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- Insert After Second Paragraph Without Tag?
- User Defined order on get_categories?
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Create an array from an array
- Using wp_get_image_editor in a standalone script
- When would you use $_post instead of $post?
- page template for attachement page?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Must Use Plugin Causing Query Error
- Shortcode return function with link href inside PHP
- Set WordPress Default Template
- Can’t get page content in WordPress
- How can I add multiple ‘tax_query’ arrays via a loop?
- Showing content from one page on another
- How to insert a single row to WP database table?
- Get date numerical and separate?
- How to check if a meta value has already been assigned to any user?
- How to call plugin function per site in a multisite?
- Unique icons next to each WordPress menu item
- Function works everywhere, how to keep it to execute when creating a new post
- Display an image if odd number of posts in grid
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Pagination broken on is_front_page()
- Reading settings in the home page precisely home.php
- Is there a hack for using is_page() within the function.php file?
- How to add ASCII symbol after each recent post [closed]
- the_post(); prints out style text into my HTML?
- Programmatically revert to backup .htaccess a possibility?
- WordPress User Meta value variable into Google Gauge Chart
- PHP function for horizontal Woocommerce thumbnails and badges
- Embed video from streamtape using direct link
- Is there a PHP function that will return the block ID generated by WordPress?
- Creating a Function and Call It
- WooCommerce display price before add to cart [closed]
- Advertisement in Loop Posts wordpress
- Theme editing “post thumbnail” help
- Restrict File Type Uploads by User on Wordress via functions.php
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- Matching multi user
- AJAX Returning Way Too Many Posts
- Where can I find the declaration of `$_wp_theme_features`?
- redirect 301 with special character like WIX site “#!”
- How I can add div to menu?
- How to print redirected query string variables to the page?
- Limit ads appearing more than three times
- Admin-area broken through weird issues
- Check if values exists DB
- Select area and checkbox data is not saving?
- How to modify this function to exclude also the post belonging to a specific category?
- Suppress errors when using global function
- Help with if/else loop [closed]
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress