From 38340fd05584072ab0041ce567caf49af159c585 Mon Sep 17 00:00:00 2001 From: turpoint Date: Tue, 11 Jun 2024 08:58:14 +0200 Subject: [PATCH] Disable warning in admin UI for excluded option pages --- classes/admin.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/admin.php b/classes/admin.php index 1f29761..cc670af 100644 --- a/classes/admin.php +++ b/classes/admin.php @@ -25,7 +25,12 @@ protected function init() { /** * Displays context-sensitive help to the user */ - public function submitbox_before_major_actions() { + public function submitbox_before_major_actions($page) { + // If Polylang isn't active for this page, don't display the message + if ( ! Helpers::is_option_page( $page['post_id'] ) ) { + return; + } + $current_lang = pll_current_language( 'name' ); if ( false !== $current_lang ) { /* translators: %s: current language name */