diff --git a/json-endpoints/class.wpcom-json-api-get-site-endpoint.php b/json-endpoints/class.wpcom-json-api-get-site-endpoint.php index 594bd6b8776be..4859a3b5fd21c 100644 --- a/json-endpoints/class.wpcom-json-api-get-site-endpoint.php +++ b/json-endpoints/class.wpcom-json-api-get-site-endpoint.php @@ -49,6 +49,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint { 'single_user_site' => '(bool) Whether the site is single user. Only returned for WP.com sites and for Jetpack sites with version 3.4 or higher.', 'is_vip' => '(bool) If the site is a VIP site or not.', 'is_following' => '(bool) If the current user is subscribed to this site in the reader', + 'organization_id' => '(int) P2 Organization identifier.', 'options' => '(array) An array of options/settings for the blog. Only viewable by users with post editing rights to the site. Note: Post formats is deprecated, please see /sites/$id/post-formats/', 'plan' => '(array) Details of the current plan for this site.', 'updates' => '(array) An array of available updates for plugins, themes, wordpress, and languages.', @@ -393,6 +394,11 @@ protected function render_response_key( $key, &$response, $is_user_logged_in ) { case 'is_multisite' : $response[ $key ] = $this->site->is_multisite(); break; + + case 'organization_id': + $response[ $key ] = $this->site->get_p2_organization_id(); + break; + case 'capabilities' : $response[ $key ] = $this->site->get_capabilities(); break; diff --git a/sal/class.json-api-site-base.php b/sal/class.json-api-site-base.php index 338b9652e81f9..97f4e7f279f5c 100644 --- a/sal/class.json-api-site-base.php +++ b/sal/class.json-api-site-base.php @@ -149,6 +149,15 @@ public function is_automated_transfer() { abstract protected function is_wpforteams_site(); + /** + * Getter for the p2 organization ID. + * + * @return int + */ + public function get_p2_organization_id() { + return 0; // WPForTeams\Constants\NO_ORG_ID not loaded. + } + public function is_wpcom_atomic() { return false; }