add eng version

This commit is contained in:
arlemp@selectel.ru
2021-12-09 22:29:24 +03:00
parent aba07a8e1b
commit acde7f0e8b
9 changed files with 141 additions and 54 deletions

View File

@@ -484,6 +484,28 @@ function citata_title($percon){
}
# helper find perevod author
function find_perevod($post_id){
$author = '';
$perevod_name = get_post_meta( $post_id, 'perevod_name', true );
if ( ! empty ( $perevod_name )){
$user_info = get_userdata($perevod_name);
if (isset($user_info->display_name)){
$author = $user_info->display_name;
}
}
if ($author !== ''){
return " / Translated by $author";
}
else {
return '';
}
}
add_action( 'pre_get_posts', function ($query) {