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
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Split loop into two columns, how to favor one side over the other
- Trying to establish connection to External Database
- WordPress Search Results for Multiple Post Types
- add_action shortcut?
- Passing the custom field values in the wp_get_current_user array function
- Using fwrite() and “a” appends multiple times instead of once
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- How to style options page in dashboard?
- How to insert a single row to WP database table?
- Get date numerical and separate?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Changing layout with wp_customise
- WSoD being caused by this piece of code
- Converting HTML Template to WordPress Theme
- Set the background to a default image if there isn’t a specified “featured image”
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Add a variable in functions.php and call it in single.php
- How to access global variable $menu inside a class function
- Dynamic Stylesheet loads but doesn’t finish
- Calling directories to load in wordpress
- WordPress add post format support not working
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Image media upload metabox
- Filter Select results based on selection
- How to remove the cufon script from Dzonia Lite theme [closed]
- How to remove or change the “W” icon in “My Sites”?
- Using loop pagination on single.php
- get a simple array of all of the term names that exist in all taxonomies
- Login/logout in header
- How to display posts by current user in a drop down
- Logged in user ID as post ID
- Loop with slider (slider not loading)
- How to hide all child pages with post_query?
- How does WordPress insert Paragraphs in posts
- WordPress Access allowed to fewer pages till user logs in
- How to sort posts based on the value (number) of a post’s metadata?
- Linking text within textarea of custom meta box
- only show container with next/prev links if they exist?
- How to combine wordpress_logged_in cookies in one cookie?
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- Change the WP Video Shortcode Output
- Show categories then when clicked on a category list all sub category and when clicked show all posts in that sub category
- remove wp floating submenu in wp dashboard
- How to put “Read more” link in Custom Excerpt inside p tag?
- Two Different Links for Same Product – WooCommerce [closed]
- ACF: how do I get the fields and its values of a specific group?
- How to store data from multiple forms using ajax and php
- How to control WordPress image metadata (using Imagick)?
- How to add seperate classes to no-search-result and found-search-result pages on wordrpess search – is_search()
- Get value from shortcode to do something
- PHP 8, AJAX mail form to function.php doesn’t work
- How do I add custom bulk actions to multiple custom post types?
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Error when adding excerpt to the content through functions.php
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- Get post id in a function when edit/add a post
- Making BuddyPress Activity Stream (Post Type) Featured Images Clickable [closed]
- How to check if a meta value has already been assigned to any user?
- How to complete two other input fields, completed the first