Skip to content

Commit

Permalink
Site Migrations: Add migration_source_site_domain option to sites A…
Browse files Browse the repository at this point in the history
…PI (#40552)

* Add migration source site domain to options API

* changelog

* ensure we fallback to a default empty string
  • Loading branch information
sixhours authored Jan 6, 2025
1 parent 43b05e7 commit 7aa20ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/add-option-to-sites-api
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Add new option to site options api
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'blogging_prompts_settings',
'launchpad_screen',
'launchpad_checklist_tasks_statuses',
'migration_source_site_domain',
'wpcom_production_blog_id',
'wpcom_staging_blog_ids',
'can_blaze',
Expand Down Expand Up @@ -902,6 +903,9 @@ protected function render_option_keys( &$options_response_keys ) {
case 'launchpad_checklist_tasks_statuses':
$options[ $key ] = $site->get_launchpad_checklist_tasks_statuses();
break;
case 'migration_source_site_domain':
$options[ $key ] = $site->get_migration_source_site_domain();
break;
case 'wpcom_production_blog_id':
$options[ $key ] = $site->get_wpcom_production_blog_id();
break;
Expand Down
9 changes: 9 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 @@ -1562,6 +1562,15 @@ public function get_launchpad_checklist_tasks_statuses() {
return array();
}

/**
* Get site option for migration source site domain
*
* @return string
*/
public function get_migration_source_site_domain() {
return get_option( 'migration_source_site_domain', '' );
}

/**
* Detect whether a site is WordPress.com Staging Site.
*
Expand Down

0 comments on commit 7aa20ee

Please sign in to comment.