mirror of
https://gh.wpcy.net/https://github.com/fairpm/server.git
synced 2026-06-20 03:02:27 +08:00
12 lines
352 B
PHP
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 );
|