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
- Why is wp_head() creating a top margin at the top of my theme header?
- What is $post_id? is it a global variable in WordPress?
- How to limit wordpress menu depth in admin panel
- How can I set image sizes and still have responsive images using the srcset attribute?
- Call dynamic_sidebar but include/exclude named widgets?
- Possible to “Attach” images to multiple posts without inserting or uploading twice?
- Trigger Customizer saving process with Javascript only
- Remove settings if theme is deleted?
- Adding customizer styles with wp_add_inline_style
- Adding widgets programatically: how to avoid collisions?
- Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
- How do I get a parent theme modification from a child theme?
- Removing the default sidebar from admin panel
- Extend walker – navigation, adding data attribute to a tag
- How to display category specific post content on a page
- Is there any need to use both wp_reset_postdata and wp_reset_query together?
- how to pull wordpress post comments to a external page
- Enqueued Stylesheets Effecting Admin Styles
- How to change the customizer´s sidebar width?
- Why is $GLOBALS[‘content_width’] needed if site is responsive?
- How i can get widgets areas working in customizer?
- current-menu-item class not working
- Correctly using wp_head()
- Theme development question regarding layouts
- Cannot figure out how to overwrite files in child theme
- Using wp_tag_cloud(‘format=array’) to print tag names without links?
- Link to a .po file in a child theme
- Alias to theme folder for local development
- My Admin bar covers my sticky navbar [closed]
- Responsive embed for the video shortcode
- Access theme options in templates
- How to show post from category select
- How to append to menu items selectively
- How to create a multiple choice radio group for a single theme option
- Working with a WP Starter theme
- tag is being auto inserted
- How remove render blocking css from wordpress when you build a theme?
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- Move default page templates to sub directory
- Displaying details of a post in a sidebar
- How to upload/update theme from local – bitbucket – shared hosting?
- Migrated WordPress site renders Chinese
- Multi-page posts: A subdirectory for each post?
- Remove “You are using WordPress 3.2.1” from Right Now Dashboard Widget
- Load sidebar template just once to prevent multiple animations
- Where do files uploaded via Media Manager get stored in MU?
- How to use custom function in posts and pages templates
- Change frontpage content via WordPress
- How to Have a Pure HTML Sub Directory In WP Site
- What are the critical theme files when building a custom theme?
- Linking beetween pages in wordpress
- Having issue with WordPress wp_enqueue_style
- search.php file not pointing where it should
- How do I get standard posts to open up in their own template when using get_template_part()?
- customize theme with get_template_part() [closed]
- Loading issue on Chrome for my WordPress theme
- How to add post meta fields to an article’s as meta elements
- Callback Function Not Firing On Selection In Media Uploader
- Add content after get_header
- Filter didn’t work on content class (hybrid_post_attributes)
- How to remove bullets from widget
- Link to RSS feed not clickable?
- Exclude function from homepage only?
- Adding google fonts to WordPress theme
- Require once a general library
- 3 Level Menu Navigation (3rd Level not displaying)
- Created blank theme for REST API, featured image not appearing on admin side
- How to echo inside the js file with wp_localize_script?
- overlay post title over post’s featured image
- Child theme in separate WordPress Install
- Display problems in admin dashboard when creating a new theme from scratch
- how to add jquery to wordpress
- Hook in parent theme Menu function
- How to add custom nav_menu_css_class to certain menu only?
- Need help with adding custom menu content
- How to avoid Ajax in wordpress theme in making mulitple request?
- Import from HubSpot COS into WordPress 4?
- child comments not displaying as nested
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- Simple loop with shortcode rendering problem
- Theme automatically inserting “more” tag on every post
- How get the 10 most viewed pages (not post)
- WordPress widgets manager option for emulating theme layout
- Conditional tags issue for multiple is_page() conditions in sidebar.php
- Pagination adds product to cart Woo-Commerce
- Onepage with shortcodes
- Allowed memory size of (…) exhausted
- have_posts() return false on single post
- Twenty sixteen – full height
- Creating image grid on products page in wordpress
- Insert gutenberg blocks into template
- What is the point of using archive.php instead of index.php?