From 4cdafb3ab0e84928c10b82c4437e52b3cd297d38 Mon Sep 17 00:00:00 2001 From: Mohammed Noumaan Ahamed Date: Wed, 21 Jan 2026 12:43:08 +0530 Subject: [PATCH] fix: load translations at the init action --- app/admin/RTMediaUploadTermsAdmin.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/admin/RTMediaUploadTermsAdmin.php b/app/admin/RTMediaUploadTermsAdmin.php index c8dd3f57e..277b48415 100755 --- a/app/admin/RTMediaUploadTermsAdmin.php +++ b/app/admin/RTMediaUploadTermsAdmin.php @@ -37,8 +37,7 @@ class RTMediaUploadTermsAdmin { * Constructing settings for upload terms. */ public function __construct() { - $this->upload_terms_message = esc_html__( 'terms of services.', 'buddypress-media' ); - $this->upload_terms_error_message = esc_html__( 'Please check terms of service.', 'buddypress-media' ); + add_action( 'init', array( $this, 'init_translations' ), 5 ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ), 999 ); add_filter( 'rtmedia_general_content_default_values', array( $this, 'add_admin_option_default_value' ), 10, 1 ); @@ -46,6 +45,14 @@ public function __construct() { add_filter( 'rtmedia_general_content_add_itmes', array( $this, 'admin_setting_add_terms_option' ), 10, 2 ); } + /** + * Initialize translations at the proper time. + */ + public function init_translations() { + $this->upload_terms_message = esc_html__( 'terms of services.', 'buddypress-media' ); + $this->upload_terms_error_message = esc_html__( 'Please check terms of service.', 'buddypress-media' ); + } + /** * Loads styles and scripts *