server/content/plugins/f-translate/templates/translations.api.php
Ryan McCue 3e7bc6e67b Initial export of the repository
Signed-off-by: Ryan McCue <me@ryanmccue.info>
2025-06-05 11:48:47 +02:00

12 lines
352 B
PHP

<?php
foreach ( $translations as $index => $translation ) {
foreach ( (array) $translation as $key => $value ) {
if ( $value instanceof WP_User ) {
$translations[ $index ]->$key = (object) array_intersect_key( (array) $value->data, array_flip( array(
'user_login',
'display_name',
) ) );
}
}
}
echo wp_json_encode( $translations );