Skip to content

Commit

Permalink
SAL: Add wpcom_site_setup property to /sites/{siteId} endpoint (#31664)
Browse files Browse the repository at this point in the history
* Add wpcom_site_setup property to /sites/{siteId} endpoint

* Add changelog
  • Loading branch information
miksansegundo authored Jul 4, 2023
1 parent a9375fc commit 59d50f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Add wpcom_site_setup property to /sites/{siteId} endpoint
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'is_wpcom_staging_site' => '(bool) If the site is a WP.com staging site.',
'user_interactions' => '(array) An array of user interactions with a site.',
'was_ecommerce_trial' => '(bool) If the site ever used an eCommerce trial.',
'wpcom_site_setup' => '(string) The WP.com site setup identifier.',
);

/**
Expand Down Expand Up @@ -201,6 +202,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'wpcom_production_blog_id',
'wpcom_staging_blog_ids',
'can_blaze',
'wpcom_site_setup',
);

/**
Expand Down Expand Up @@ -878,6 +880,9 @@ function ( $key ) use ( $visible_options ) {
case 'can_blaze':
$options[ $key ] = $site->can_blaze();
break;
case 'wpcom_site_setup':
$options[ $key ] = $site->get_wpcom_site_setup();
break;
}
}

Expand Down
9 changes: 9 additions & 0 deletions projects/plugins/jetpack/sal/class.json-api-site-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1501,4 +1501,13 @@ abstract public function get_wpcom_staging_blog_ids();
public function can_blaze() {
return (bool) Blaze::site_supports_blaze( $this->blog_id );
}

/**
* Return site's setup identifier.
*
* @return string
*/
public function get_wpcom_site_setup() {
return get_option( 'wpcom_site_setup' );
}
}

0 comments on commit 59d50f4

Please sign in to comment.