Skip to content

Commit

Permalink
Update is_options_menu() to is_dedicated_plugin_screen() in Validatio…
Browse files Browse the repository at this point in the history
…nCounts class
  • Loading branch information
thelovekesh committed Feb 7, 2023
1 parent 378522c commit 3c17ea9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Admin/ValidationCounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function register() {
* Enqueue admin assets.
*/
public function enqueue_scripts() {
if ( $this->is_options_menu() ) {
if ( $this->is_dedicated_plugin_screen() ) {
do_action( 'amp_register_polyfills' );
}

Expand Down Expand Up @@ -123,15 +123,15 @@ public function enqueue_scripts() {
* screen related to `amp_validation_error` post type (which includes the `amp_validation_error` taxonomy).
*/
protected function maybe_add_preload_rest_paths() {
if ( $this->is_options_menu() ) {
if ( $this->is_dedicated_plugin_screen() ) {
$this->rest_preloader->add_preloaded_path( '/amp/v1/unreviewed-validation-counts' );
}
}

/**
* Whether the current screen is pages inside the AMP Options menu.
*/
public function is_options_menu() {
public function is_dedicated_plugin_screen() {
return (
AMP_Options_Manager::OPTION_NAME === get_admin_page_parent()
||
Expand Down

0 comments on commit 3c17ea9

Please sign in to comment.