_get_path_to_translation( string $domain, bool $reset = false ): string|false
- Since
- 4.7.0
- Source
wp-includes/deprecated.php:4397
Gets the path to a translation file for loading a textdomain just in time.
Description
Caches the retrieved results internally.
Parameters
$domainstring- Text domain. Unique identifier for retrieving translated strings.
$resetbooloptional- Whether to reset the internal cache. Used by the switch to locale functionality.Default:
false
Return
string|false- The path to the translation file or false if no translation file was found.
Uses · 2
- _deprecated_function()Marks a function as deprecated and inform when it has been used.
- _get_path_to_translation_from_lang_dir()Gets the path to a translation file in the languages directory for the current locale.
Source
function _get_path_to_translation( $domain, $reset = false ) { _deprecated_function( __FUNCTION__, '6.1.0', 'WP_Textdomain_Registry' ); static $available_translations = array(); if ( true === $reset ) { $available_translations = array(); } if ( ! isset( $available_translations[ $domain ] ) ) { $available_translations[ $domain ] = _get_path_to_translation_from_lang_dir( $domain ); } return $available_translations[ $domain ];}History
Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.1.0
Deprecated.from the docblock
4.7.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/deprecated.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.