Skip to content

Commit

Permalink
Remove rate plugin CTA from options.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Jan 14, 2024
1 parent 6cc50a7 commit 094a2bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 6 additions & 2 deletions src/php/Settings/Abstracts/SettingsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/php/Settings/PluginSettingsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class="ctl-<?php echo esc_attr( $this->section_title() ); ?>"
* @return string|mixed
*/
public function admin_footer_text( $text ) {
if ( ! $this->is_options_screen() ) {
if ( ! $this->is_options_screen( [] ) ) {
return $text;
}

Expand Down

0 comments on commit 094a2bc

Please sign in to comment.