Skip to content

Commit

Permalink
REST API: JPO - save site type (#8431)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored and oskosk committed Jan 4, 2018
1 parent daad2bd commit bc4f914
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _inc/lib/core-api/class.jetpack-core-api-module-endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,12 @@ private function _process_onboarding( $data ) {
$site_title = get_option( 'blogname' );
$author = get_current_user_id() || 1;

if ( ! empty( $data['siteType'] ) ) {
if ( ! ( update_option( 'jpo_site_type', $data['siteType'] ) || get_option( 'jpo_site_type' ) == $data['siteType'] ) ) {
$error[] = 'siteType';
}
}

// If $data['homepageFormat'] is 'posts', we have nothing to do since it's WordPress' default
if ( isset( $data['homepageFormat'] ) && 'page' === $data['homepageFormat'] ) {
if ( ! ( update_option( 'show_on_front', 'page' ) || get_option( 'show_on_front' ) == 'page' ) ) {
Expand Down
1 change: 1 addition & 0 deletions class.jetpack-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ static function get_all_wp_options() {
'jetpack_sso_require_two_step',
'jetpack_sso_remove_login_form',
'jetpack_last_connect_url_check',
'jpo_site_type',
);
}

Expand Down

0 comments on commit bc4f914

Please sign in to comment.