This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use MO::make_entry() instead.
WP_Translations::make_entry( string $original, string $translations )
Builds a Translation_Entry from original string and translation strings.
Description
See also
Parameters
- $original
-
(string) (Required) Original string to translate from MO file. Might contain 0x04 as context separator or 0x00 as singular/plural separator.
- $translations
-
(string) (Required) Translation strings from MO file.
Return
(Translation_Entry) Entry instance.
Source
File: wp-includes/l10n/class-wp-translations.php
private function make_entry( $original, $translations ): Translation_Entry {
$entry = new Translation_Entry();
// Look for context, separated by \4.
$parts = explode( "\4", $original );
if ( isset( $parts[1] ) ) {
$original = $parts[1];
$entry->context = $parts[0];
}
$entry->singular = $original;
$entry->translations = explode( "\0", $translations );
$entry->is_plural = count( $entry->translations ) > 1;
return $entry;
}
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |