diff --git a/projects/plugins/jetpack/changelog/add-site-intent b/projects/plugins/jetpack/changelog/add-site-intent new file mode 100644 index 0000000000000..36a56d996abb3 --- /dev/null +++ b/projects/plugins/jetpack/changelog/add-site-intent @@ -0,0 +1,4 @@ +Significance: minor +Type: other + +Expose site intent from get site API to show different content in the future diff --git a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-site-endpoint.php b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-site-endpoint.php index b395da845efcf..eac8dcbad8660 100644 --- a/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-site-endpoint.php +++ b/projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-site-endpoint.php @@ -157,6 +157,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint { 'is_cloud_eligible', 'selected_features', 'anchor_podcast', + 'site_intent', ); protected static $jetpack_response_field_additions = array( @@ -669,6 +670,9 @@ protected function render_option_keys( &$options_response_keys ) { case 'anchor_podcast': $options[ $key ] = $site->get_anchor_podcast(); break; + case 'site_intent': + $options[ $key ] = $site->get_site_intent(); + break; } } diff --git a/projects/plugins/jetpack/sal/class.json-api-site-base.php b/projects/plugins/jetpack/sal/class.json-api-site-base.php index 12b8d22070fc5..802e7b0ee5534 100644 --- a/projects/plugins/jetpack/sal/class.json-api-site-base.php +++ b/projects/plugins/jetpack/sal/class.json-api-site-base.php @@ -726,4 +726,11 @@ public function get_selected_features() { public function get_anchor_podcast() { return get_option( 'anchor_podcast' ); } + + /** + * Get the option of site intent which value is coming from the Hero Flow + */ + public function get_site_intent() { + return get_option( 'site_intent', '' ); + } }