Skip to content

Commit 35d64b8

Browse files
committed
Group is_active_in_admin_bar with other public methods.
1 parent 41ee540 commit 35d64b8

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

includes/Modules/Analytics.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,22 @@ public function on_deactivation() {
206206
$this->options->delete( 'googlesitekit_analytics_adsense_linked' );
207207
}
208208

209+
/**
210+
* Checks if the module is active in the admin bar for the given URL.
211+
*
212+
* @since n.e.x.t
213+
*
214+
* @param string $url URL to determine active state for.
215+
* @return bool
216+
*/
217+
public function is_active_in_admin_bar( $url ) {
218+
if ( ! $this->is_connected() ) {
219+
return false;
220+
}
221+
222+
return $this->has_data_for_url( $url );
223+
}
224+
209225
/**
210226
* Outputs gtag snippet.
211227
*
@@ -1240,22 +1256,6 @@ protected function setup_settings() {
12401256
return new Settings( $this->options );
12411257
}
12421258

1243-
/**
1244-
* Checks if the module is active in the admin bar for the given URL.
1245-
*
1246-
* @since n.e.x.t
1247-
*
1248-
* @param string $url URL to determine active state for.
1249-
* @return bool
1250-
*/
1251-
public function is_active_in_admin_bar( $url ) {
1252-
if ( ! $this->is_connected() ) {
1253-
return false;
1254-
}
1255-
1256-
return $this->has_data_for_url( $url );
1257-
}
1258-
12591259
/**
12601260
* Checks whether Analytics data exists for the given URL.
12611261
*

includes/Modules/Search_Console.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ public function get_scopes() {
109109
);
110110
}
111111

112+
/**
113+
* Checks if the module is active in the admin bar for the given URL.
114+
*
115+
* @since n.e.x.t
116+
*
117+
* @param string $url URL to determine active state for.
118+
* @return bool
119+
*/
120+
public function is_active_in_admin_bar( $url ) {
121+
if ( ! $this->get_property_id() ) {
122+
return false;
123+
}
124+
125+
return $this->has_data_for_url( $url );
126+
}
127+
112128
/**
113129
* Returns the mapping between available datapoints and their services.
114130
*
@@ -486,20 +502,4 @@ protected function setup_services( Google_Site_Kit_Client $client ) {
486502
protected function setup_settings() {
487503
return new Settings( $this->options );
488504
}
489-
490-
/**
491-
* Checks if the module is active in the admin bar for the given URL.
492-
*
493-
* @since n.e.x.t
494-
*
495-
* @param string $url URL to determine active state for.
496-
* @return bool
497-
*/
498-
public function is_active_in_admin_bar( $url ) {
499-
if ( ! $this->get_property_id() ) {
500-
return false;
501-
}
502-
503-
return $this->has_data_for_url( $url );
504-
}
505505
}

0 commit comments

Comments
 (0)