Skip to content
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
5 changes: 5 additions & 0 deletions json-endpoints/class.wpcom-json-api-get-site-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'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',
'is_fse_active' => '(bool) If the site has Full Site Editing active or not.',
'is_fse_eligible' => '(bool) If the site is capable of Full Site Editing or not',
);

protected static $no_member_fields = array(
Expand All @@ -72,6 +73,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'meta',
'launch_status',
'is_fse_active',
'is_fse_eligible',
);

protected static $site_options_format = array(
Expand Down Expand Up @@ -383,6 +385,9 @@ protected function render_response_key( $key, &$response, $is_user_logged_in ) {
case 'is_fse_active':
$response[ $key ] = $this->site->is_fse_active();
break;
case 'is_fse_eligible':
$response[ $key ] = $this->site->is_fse_eligible();
break;
}

do_action( 'post_render_site_response_key', $key );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class WPCOM_JSON_API_GET_Site_V1_2_Endpoint extends WPCOM_JSON_API_GET_Site_Endp
'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',
'is_fse_active' => '(bool) If the site has Full Site Editing active or not.',
'is_fse_eligible' => '(bool) If the site is capable of Full Site Editing or not',
);


Expand Down
17 changes: 17 additions & 0 deletions sal/class.json-api-site-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,23 @@ function is_fse_active() {
return function_exists( '\A8C\FSE\is_full_site_editing_active' ) && \A8C\FSE\is_full_site_editing_active();
}

/**
* Check if site should be considered as eligible for full site editing. Full site editing
* requires the FSE plugin to be installed and activated. For this method to return true
* the current theme does not need to be FSE compatible. The plugin can also be explicitly
* disabled via the a8c_disable_full_site_editing filter.
*
* @since 8.1.0
*
* @return bool true if site is eligible for full site editing
*/
public function is_fse_eligible() {
if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) {
return false;
}
return function_exists( '\A8C\FSE\is_site_eligible_for_full_site_editing' ) && \A8C\FSE\is_site_eligible_for_full_site_editing();
}

/**
* Return the last engine used for an import on the site.
*
Expand Down