Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support site_intent for /me/sites endpoint #21880

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/add-site-intent
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Expose site intent from get site API to show different content in the future
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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;
}
}

Expand Down
7 changes: 7 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 @@ -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', '' );
}
}