On this page
Translations::add_entry_or_merge( array|Translation_Entry $entry ): bool
Parameters
$entryarray|Translation_Entry Required
Return
bool
Source
File: wp-includes/pomo/translations.php. View all references
public function add_entry_or_merge( $entry ) {
if ( is_array( $entry ) ) {
$entry = new Translation_Entry( $entry );
}
$key = $entry->key();
if ( false === $key ) {
return false;
}
if ( isset( $this->entries[ $key ] ) ) {
$this->entries[ $key ]->merge_with( $entry );
} else {
$this->entries[ $key ] = &$entry;
}
return true;
}
Related
Uses
| Uses | Description |
|---|---|
| Translation_Entry::__construct() wp-includes/pomo/entry.php |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/translations/add_entry_or_merge