diff --git a/readme.txt b/readme.txt index a77ca97..a7d0948 100644 --- a/readme.txt +++ b/readme.txt @@ -226,6 +226,7 @@ Yes, you can! * Tested with WooCommerce 8.4. * Tested with PHP 8.3. * Fixed documentation on ctl_allow filter. +* Fixed improper display of the "rate plugin" message on options.php. = 6.0.5 (09.10.2023) = * Fixed displaying file descriptions in the Theme Editor; now in the current locale. diff --git a/src/php/Settings/Abstracts/SettingsBase.php b/src/php/Settings/Abstracts/SettingsBase.php index 0a11eb5..9e1e9ca 100644 --- a/src/php/Settings/Abstracts/SettingsBase.php +++ b/src/php/Settings/Abstracts/SettingsBase.php @@ -1205,9 +1205,13 @@ public function load_plugin_textdomain() { /** * Is current admin screen the plugin options screen. * + * @param string|array $ids Additional screen id or ids to check. + * * @return bool */ - protected function is_options_screen(): bool { + protected function is_options_screen( $ids = 'options' ): bool { + $ids = (array) $ids; + if ( ! function_exists( 'get_current_screen' ) ) { return false; } @@ -1224,7 +1228,7 @@ protected function is_options_screen(): bool { $screen_id = str_replace( 'settings_page', 'toplevel_page', $screen_id ); } - return 'options' === $current_screen->id || $screen_id === $current_screen->id; + return $screen_id === $current_screen->id || in_array( $current_screen->id, $ids, true ); } /** diff --git a/src/php/Settings/PluginSettingsBase.php b/src/php/Settings/PluginSettingsBase.php index 5b0cb34..7525690 100644 --- a/src/php/Settings/PluginSettingsBase.php +++ b/src/php/Settings/PluginSettingsBase.php @@ -184,7 +184,7 @@ class="ctl-section_title() ); ?>" * @return string|mixed */ public function admin_footer_text( $text ) { - if ( ! $this->is_options_screen() ) { + if ( ! $this->is_options_screen( [] ) ) { return $text; }