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

Unlaunched sites: Set a blog option of "unlaunched" to sites that are created private #10560

Merged
merged 2 commits into from
Dec 4, 2018
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
7 changes: 6 additions & 1 deletion json-endpoints/class.wpcom-json-api-get-site-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'jetpack_modules' => '(array) A list of active Jetpack modules.',
'meta' => '(object) Meta data',
'quota' => '(array) An array describing how much space a user has left for uploads',
'launch_status' => '(string) A string describing the launch status of a site',
);

protected static $no_member_fields = array(
Expand All @@ -68,6 +69,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'is_private',
'is_following',
'meta',
'launch_status',
);

protected static $site_options_format = array(
Expand Down Expand Up @@ -125,7 +127,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'has_pending_automated_transfer',
'woocommerce_is_active',
'design_type',
'site_goals'
'site_goals',
);

protected static $jetpack_response_field_additions = array(
Expand Down Expand Up @@ -364,6 +366,9 @@ protected function render_response_key( $key, &$response, $is_user_logged_in ) {
case 'quota' :
$response[ $key ] = $this->site->get_quota();
break;
case 'launch_status' :
$response[ $key ] = $this->site->get_launch_status();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break;
}

do_action( 'post_render_site_response_key', $key );
Expand Down
4 changes: 4 additions & 0 deletions sal/class.json-api-site-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,4 +628,8 @@ function get_site_goals() {
$options = get_option( 'options' );
return empty( $options[ 'siteGoals'] ) ? null : $options[ 'siteGoals' ];
}

function get_launch_status() {
return false;
}
}