From 2fee0c41d8d46a6ad6a5e481ef9df813e17c6c99 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Sat, 11 May 2024 17:22:51 +0200 Subject: [PATCH] Use user's profile language instead of site language --- public/class-h5p-plugin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/class-h5p-plugin.php b/public/class-h5p-plugin.php index d9fe5e3..9fc3180 100644 --- a/public/class-h5p-plugin.php +++ b/public/class-h5p-plugin.php @@ -806,9 +806,8 @@ public function get_h5p_url($absolute = FALSE) { * @return string */ public function get_language() { - if (defined('WPLANG')) { - $language = WPLANG; - } + $user = wp_get_current_user(); + $language = get_user_meta($user->ID, 'locale', true); if (empty($language)) { $language = get_option('WPLANG');