The general rule is that you should escape as close to the place of actual output as possible. The reason for that is that if your escape is far removed from output then you assume output to be escaped… Until at some point in the future something changes in the other corner of the file and that’s no longer the case.
On what should be escaped is mostly matter of how likely it is to contain unsafe and/or user–produced input. Template tags are rarely explicitly escaped. In some cases escaping them would actively break stuff if they are intended to have HTML in the output under some circumstances. Like infamous admins being able to put HTML into titles.
Notably you can’t HTML escape a whole block of HTML like a breadcrumb. Defeats the point.
You seem to be ok on localization bit.
Related Posts:
- esc_url not working within add_settings_field callback
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- What is the safe way to print tracking code / pixel code before tag or tag
- How to escape html generate by a loop
- How to escape multiple attribute at once in WordPress?
- Is there any solution, ide/tool etc., for automatic escaping for WordPress?
- How to safely return the HTML?
- wp_kses allow checkbox class and checked
- What is best practice when escaping the_title()?
- If necessary, how should wp_get_attachment_image() and its parameters be escaped?
- Get the first image from post content (eg.: hotlinked images)
- Getting failure when using filemtime() with wp_enqueue_style
- Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?
- How bad is it if I write AJAX functions using wp-load.php?
- How to know if a child theme is being used?
- How to modify an image block in Gutenberg WordPress 5?
- wp_nav_menu sort order?
- Twenty Eleven home page show only excerpt
- How do I show sticky posts on a static front page that also contains content?
- Snippet: Use classes instead of inline styles for text alignment
- Make a custom theme translate-ready
- Grab the first paragraph of each post
- Wrapper class: How to get rid of call_user_func_array() warning?
- Change Genesis Tag from Page Template [closed]
- How to Handle CSS for Multiple Header header.php Files?
- Why is save_post triggered even when I havent saved the post
- Add custom field automatically to custom page types
- Resources for a complete beginner to learn to work professionally with WordPress [closed]
- How to tell if the user is an admin?
- Adding WordPress colorpicker in widget settings
- What is wrong with this code I have to make a blockquote shortcode
- Add social icons in a theme through custom admin menu
- file_get_contents Not allowed in Themes?
- Removing title tags from each page
- How to attach different React Components to different Dom Roots using the new WP wordpress/scripts webpack/babel
- front-page.php is not Listing in Static Front Page List
- Remove Cookies From WordPress Core
- Is it necessary to prefix every css class in a theme framework?
- Warning/Error in Admin Panel while developing theme
- How do I get the next page of posts link?
- display 20 lines only with the_content
- How do I remove twentyten without ruining what I did?
- Where can I access my custom page template?
- How to display posts in hyperlink with nested slugs?
- How to To Filter wp_enqueue_script() Scripts on Some Pages
- Check if tag, category or author on archive.php
- Editing Footer Information
- How does a mobile WordPress theme differ from a simple theme?
- Developing WordPress Theme using CSS framework like Bootstrap
- WordPress empty Nav Menu error
- Add “Delete” button to my Theme
- How to add a button which saves the post then executes a function
- Disable dashboard drag&drop
- nothing happen in search form
- Catagories to the list of the titles in that catagory to the content of the post [closed]
- How to customize output of plugin
- Override customizer values on a per-menu base
- Theme Inspector “X-Ray”
- Trackbacks not displaying
- Post Content Displaying Below ALL Shortcodes Content
- If you were to start using a WordPress framework today, which one would you use? [closed]
- Register sidebar ‘before’ and ‘after’ html as div rather than li tags
- WordPress Template Part in iFrame
- Can I add an icon & function to the “Upload/Insert” toolbar at the top of the content editor?
- Is it possible to have a theme that uses only one single page?
- JQuery undefined and Stylesheet loads in bottom along with js files
- Why tags are displayed bellow the content and not inside
- What’s the best way to create a new design for other pages?
- Consequences if using PHP include TEMPLATEPATH?
- Adding a gallery to my first theme
- Headless WordPress + Vue.js on the same server
- not getting API setting saved confirmation message after update on option page
- Single.php the_excerpt loads same as the_content not loading read more line
- Is there a way to retrieve the calling template part?
- WP_Query not getting all posts, just tagged posts
- how to hide home nav link in wordpress
- Converting a theme to a child theme in a network
- Calling a WP Plugin Function’s Variable in Theme Template [duplicate]
- Why excerpt hook not working inside ajax function?
- Help with Core Mods
- How to handle theme activation errors?
- Local variable name in setup_postdata()
- Child theme menu not appearing in Twenty Seventeen
- how to edit woocommerce checkout page
- Does any JavaScript file load automatically for index.php file?
- WordPress menu walker – Get parent item text inside end_lvl function
- Display content on Single page
- WordPress Ajax Spitting out a page as a response?
- Filter URL and shortcodes from the_excerpt
- Check if redirected from a specific page template
- Postname permalink page not found error
- After theme change the menus have to be manually linked to the corresponding theme location
- What’s the policy for building a theme that doesn’t support widgets/menus?
- Incorporate zilla shortcode into theme
- Import/Export WordPress demo
- Global Navigation menu in diiferrent wordpress setups
- Is it possible to use “wordpress.org Theme Handbook” look&feel as a theme in my own site? [closed]
- getting id of page
- How to make a sticky footer?
- How can i display a 4 diferent themplate for the archive page