WP_Translation_Controller::get_files
Returns all translation files for a given text domain.
Method of the class: WP_Translation_Controller{}
No Hooks.
Returns
WP_Translation_File[]. List of translation files.
Usage
// protected - for code of main (parent) or child class $result = $this->get_files( $textdomain, ?string $locale ): array;
- $textdomain(string)
- Text domain.
Default:'default' - ?string $locale
- .
Default:null
Changelog
| Since 6.5.0 | Introduced. |
WP_Translation_Controller::get_files() WP Translation Controller::get files code WP 6.9.1
protected function get_files( string $textdomain = 'default', ?string $locale = null ): array {
if ( null === $locale ) {
$locale = $this->current_locale;
}
return $this->loaded_translations[ $locale ][ $textdomain ] ?? array();
}