WP_Translation_File::translate
Translates a given string.
Method of the class: WP_Translation_File{}
No Hooks.
Returns
false|String. Translation(s) on success, false otherwise.
Usage
$WP_Translation_File = new WP_Translation_File(); $WP_Translation_File->translate( $text );
- $text(string) (required)
- String to translate.
Changelog
| Since 6.5.0 | Introduced. |
WP_Translation_File::translate() WP Translation File::translate code WP 6.8.3
public function translate( string $text ) {
if ( ! $this->parsed ) {
$this->parse_file();
}
return $this->entries[ $text ] ?? false;
}