Skip to content

Commit e88f527

Browse files
committed
Added is Jetpack connected check
1 parent b3dc444 commit e88f527

File tree

1 file changed

+5
-0
lines changed
  • projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles

1 file changed

+5
-0
lines changed

projects/packages/jetpack-mu-wpcom/src/features/wpcom-global-styles/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,11 @@ function wpcom_site_has_global_styles_feature( $blog_id = 0 ) {
719719
* @return bool Whether the current user is assigned to a non-null variation for the experiment.
720720
*/
721721
function wpcom_global_styles_assignment_api_request( $experiment_key ) {
722+
$connection_manager = new Automattic\Jetpack\Connection\Manager();
723+
if ( ! $connection_manager->is_user_connected() ) {
724+
return false;
725+
}
726+
722727
$path = '/me/explat-assignments';
723728
$body = array( 'experiment' => (string) $experiment_key );
724729
$response = Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_user(

0 commit comments

Comments
 (0)