You cannot use constants or anything other than actual strings with translation functions.
This is because the code that reads your code, and produces the translatable strings does not actually run your code, it is reading your code.
Here is a more detailed post on the topic:
http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/
But the short version is this:
This is wrong:
<?php esc_html_e( ADDRESS, 'wprig' ); ?>
Nothing will make that right except this:
<?php esc_html_e( 'Actual String here', 'wprig' ); ?>
Related Posts:
- How Flexible are the WordPress Coding Standards for PHPCS?
- What characters do I need to escape in XML documents?
- What characters must be escaped in HTML 5?
- How can I selectively escape percent (%) in Python strings?
- How do I escape a single quote in jQuery?
- Escape Character in SQL Server
- How to escape apostrophe (‘) in MySql?
- Should HTML output be passed through esc_html() AND wp_kses()?
- How to prevent escaping when saving HTML code in an option value?
- How to correctly escape query variables to be used in WP_Query
- esc_attr / esc_html / esc_url in echos
- When do I need to use esc_html()? [duplicate]
- PHP Coding Standards, Widgets and Sanitization
- how to escape wp_oembed_get for phpcs
- what’s different between esc_attr, htmlspecialchars and htmlentities
- Allow all attributes in $allowedposttags tags
- When outputting a static string to the page, is it necessary to escape the output?
- why is esc_html() returning nothing given a string containing a high-bit character?
- How to properly escape a translated string?
- Using esc_url() on a url more than once
- Do I need to escape get_theme_mod(‘url’) / (‘mail’) with esc_url?
- How to allow   with wp_kses()?
- Using esc_attr_e
- Why esc_html_() is not used on every text that has a translation (on Twenty Twenty One)?
- Escaping crashes my output
- How to safely escape the title attribute
- How to safely escape data that contains HTML attributes
- Can wp_strip_all_tags be used as a substitute for esc_url, esc_attr & esc_html?
- Echoing a URL to a link
- wp_kses_post escaping doesn’t appear to work as described?
- file_get_contents | escaping doesnt show the page
- Help about Escaping
- How to keep specific tag from an html string?
- Escaping Issues
- Escaping and Special Characters (e.g. &)
- Escaping get_option( ‘time_format’ ) is nesserary?
- How should esc_url be combined with trailingslashit?
- Correct way of using esc_attr() and esc_html()
- How to Git stash pop specific stash in 1.8.3?
- What are all the escape characters?
- Which characters need to be escaped when using Bash?
- How do I use spaces in the Command Prompt?
- Why is WordPress code so “space-happy”?
- Why isn’t WordPress part of Framework Interop Group?
- Best Practice for PHP
- Escaping and sanitizing SVGs in metabox textarea
- Difference between esc_url() and esc_url_raw()
- When to use Exceptions vs Error Objects vs just plain false/null
- What to use instead of wp_kses() in user output
- WordPress and event-driven programming – what is it about?
- How to escape custom css?
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- How should I document function calls?
- Should messages in WP_Error already be html escaped?
- Avoiding “Usage of a direct database call is discouraged”
- Nonce in settings API with tabbed navigation
- Do you need to escape hard coded plain text?
- Escaping built-in WP function return strings
- How do I stop HTML entities in a custom meta box from being un-htmlentitied?
- Why should I escape translatable strings? and how shall i do that?
- esc_url not working within add_settings_field callback
- Do I need to use the esc_html() function on hard coded links?
- Correct processing of `$_POST`, following WordPress Coding Standards
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- PHPCS: Strings should have translatable content
- How Could I sanitize the receive data from this code
- Assignments must be the first block of code on a line Validation Error on Travis
- Quotes being escaped inside wp_editor when saved with wp_kses_post
- When I re-save a post with [code] sections, the entities are double-escaped (> becomes > etc)
- Escape post image attachments added to template
- wp_query not searching with apostrophe
- Which escape function to use when escaping an email or plain text?
- Something is unescaping all html entities before output to browser [closed]
- Securing/Escaping Output of file content – reading via fread() in PHP
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- Should I check for privileges before hooking into `wp_ajax_$handle` or after?
- Add comments for template variables
- WordPress stripping away backslashes from HTML
- Unexpected esc_html and esc_attr behaviour
- Why the WP Core team does not allow filter_* functions? [closed]
- WordPress Theme Validator?
- Understanding how the class family `inner-container` works
- HTML escaping data with ajax requests
- How to allow single quote with esc_html__() without sprintf()
- Proper way to use esc_html__ and esc_attr__ etc for escaping value for translation
- Wrapping add_query_arg with esc_url not working
- ACF Unexpected T_CONSTANT_ENCAPSED_STRING [closed]
- How to pass an array as attribute of shortcode to work properly shortcode parser?
- wordpress post not showing my “” text>?
- WP nonce verification
- How to make MySQL search queries with quotes
- Escape html structure in php
- site_url() returns with additional backslashes
- Sanitization html output itself
- Code auto escaping is not working when using short codes
- Escaping admin_url output being passed to js (esc_js vs esc_url)
- Escaping inline JS correctly
- What is best practice when escaping the_title()?
- If necessary, how should wp_get_attachment_image() and its parameters be escaped?
- Is it necessary to use escape functions on everything or is it only necessary if you’re taking input from a 3rd party? (End Users, APIs, Etc.)