Use sprintf()
:
// Translators: %s: author's current year.
esc_html( sprintf( __('Rates %s in €/ week:','mysite-plugin'), $current_year ) );
This is a common pattern that can be found in WordPress core. The Translators:
comment is also essential to provide translators with context to translate the passage and understand what the placeholder %s
will contain.
Related Posts:
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- WordPress Warning: preg_replace(): JIT compilation failed: no more memory
- Autoloading in Child Theme
- WSOD but WP_DEBUG not giving any errors
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- Append code into wp-config.php
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
- Looking for a better way to handle an ajax script that pulls in post data on click
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Adding featured image via PHP
- How to return multiples lines in a shortcode?
- wp_enqueue_style with style.php and WordPress functions
- fallback image for featured image
- How to set status codes such as 401 and 403?
- Minify HTML, CSS, JS with PHPWee?
- Add attribute / custom attribute to product in woocommerce
- Access/update database with jQuery
- How to create another version of my site based on the same database
- How to get bool with `get_option()` when already registered setting with type `boolean`
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- WordPress widget/sidebar dividers?
- Displaying theme options in css
- PHP code inside shortcodes
- PHP help get_template_directory + PHP include
- Latest post in a specific menu
- Querying wpdb using PHP
- Reload part of checkout on changed shipping method
- how to combine wordpress htaccess on my root domain + php on subfolder
- Input data from email form not going to JSON file
- Font Awesome changing default WordPress Font
- Should `wp_login` be used since it’s deprecated?
- admin-ajax Firing Error 400 When Logged In
- How to use a custom hook
- Hide HTML element (by class or ID) with PHP
- wp_force_remove_style’ not found
- Pagination on Custom Post
- Why can’t I return a value from $wpdb->get var?
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- change title page on search result
- Enqueing External JS on the remote server JS
- Refactoring long if/else php chains
- Trouble with a php code that adds a log in/log out button [closed]
- How to add aria role and schema markup to custom walker container
- jQuery accordion menu
- Restrict characters in comment section
- Required PHP version: 5.3.3 – Version found: 5.2.17… How or where do upgrade to 5.33 [closed]
- Adding custom url to readmore link using get_permalink()
- Remove submenu item from list
- is_user_logged_in returning nothing on custom page
- Customize field names in backend profile edit page through function.php [duplicate]
- WordPress navigation wont appear with wp_head
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- Page not visible in ‘All pages’ after being added through PHP
- How to exclude labels from certain categories in a shortcode?
- Pass a PHP function to javascript
- Nested Queries of decreasing specificity
- Wrong pagination results, page counter resets when navigating
- How can I update WordPress plugins or WordPress itself in all server?
- WooCommerce Query Product Titles
- Check $post->ID against multiple values
- alternate left – right content inside the loop
- I have a lot of JavaScript erorrs after SSL someone can help me?
- why not selecting multiple rows of same standard_id using SQL query from database?
- Rewrite rule for wp
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- Add function to head “no product found”
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- How to make this code valid only when the value exists?
- getting the values of hidden inputs to use them in a php mysql query
- How to include a function in a template with template tag
- wordpress all post filter by year
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Use header option on wp-login page with a second logo
- Pulling a variable into the wp_nav_menu function
- Post added by PHP redirects to 404 [closed]
- dropdown with no submit
- wp_query (or hook) posts by date (id) in array then set post_type
- Plugin PHP write permissions
- If custom field doesn’t exist, or exists and it’s true show title?
- Add the “.current-menu-item” class to tag?
- Custom fields randomly stop working
- How to remove parent section in an attachment URL in wordpress?
- wp_query on search results page showing all results every time
- Problem with function.php.. like
- Echo get_option displays as text
- Stop breadcrumb function retrieving custom post type template name
- Slug not being updated using wp_insert_post
- How do I run the following script from my articles page?
- Get category name of current post (CPT UI)
- Filtering image class at output
- Three different queries on same page
- Removing the add to cart button from specific product pages
- How can I run a second wp_remote_post() based on the response of the first?
- Deleting all CPT related to user deleting
- Import WordPress header / footer into an external page(s)
- Unable to logout correctly after wp-login file was modified
- Prevent WP from escaping html on edit posts screen
- Running WP-Cron on Multisite networks the right way?