Skip to content

Commit

Permalink
Site Migration: New setting for tracking the migration flow (#36974)
Browse files Browse the repository at this point in the history
* Add in_site_migration_flow site option

* Changelog

* Refactored so we're not casting multiple times

* Refactored delete vs update check
  • Loading branch information
markbiek authored Apr 22, 2024
1 parent 3ae452f commit 09a813e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Add in_site_migration_flow to the list of available site options to update and retrieve. This will be used as part of the Site Migration on-boarding flow.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
),

'request_format' => array(
'in_site_migration_flow' => '(bool) Whether the site is currently in the Site Migration signup flow.',
'blogname' => '(string) Blog name',
'blogdescription' => '(string) Blog description',
'default_pingback_flag' => '(bool) Notify blogs linked from article?',
Expand Down Expand Up @@ -468,6 +469,7 @@ function ( $newsletter_category ) {
'enable_blocks_comments' => (bool) get_option( 'enable_blocks_comments', true ),
'highlander_comment_form_prompt' => $this->get_highlander_comment_form_prompt_option(),
'jetpack_comment_form_color_scheme' => (string) get_option( 'jetpack_comment_form_color_scheme' ),
'in_site_migration_flow' => (bool) get_option( 'in_site_migration_flow', 0 ),
);

if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
Expand Down Expand Up @@ -1135,6 +1137,17 @@ function ( $category_id ) {

break;

case 'in_site_migration_flow':
$canonical_value = (int) (bool) $value;
if ( 0 === $canonical_value ) {
delete_option( 'in_site_migration_flow' );
} else {
update_option( 'in_site_migration_flow', $canonical_value );
}

$updated[ $key ] = $canonical_value;
break;

default:
// allow future versions of this endpoint to support additional settings keys.
if ( has_filter( 'site_settings_endpoint_update_' . $key ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
),

'request_format' => array(
'in_site_migration_flow' => '(bool) Whether the site is currently in the Site Migration signup flow.',
'blogname' => '(string) Blog name',
'blogdescription' => '(string) Blog description',
'default_pingback_flag' => '(bool) Notify blogs linked from article?',
Expand Down

0 comments on commit 09a813e

Please sign in to comment.