' . esc_html_e( 'No map preview available. Publish and refresh to see this widget.', 'jetpack' ) . '
';
echo '';
} else {
echo '';
}
}
}
}
/**
* Check if an asset exists for a block.
*
* @param string $file Path of the file we are looking for.
*
* @return bool $block_has_asset Does the file exist.
*/
public static function block_has_asset( $file ) {
return file_exists( JETPACK__PLUGIN_DIR . $file );
}
/**
* Get the version number to use when loading the file. Allows us to bypass cache when developing.
*
* @param string $file Path of the file we are looking for.
*
* @return string $script_version Version number.
*/
public static function get_asset_version( $file ) {
return Jetpack::is_development_version() && self::block_has_asset( $file )
? filemtime( JETPACK__PLUGIN_DIR . $file )
: JETPACK__VERSION;
}
/**
* Load Gutenberg editor assets
*
* @since 6.7.0
*
* @return void
*/
public static function enqueue_block_editor_assets() {
if ( ! self::should_load() ) {
return;
}
/**
* This can be called multiple times per page load in the admin, during the `enqueue_block_assets` action.
* These assets are necessary for the admin for editing but are not necessary for each pattern preview.
* Therefore we dequeue them, so they don't load for each pattern preview iframe.
*/
if ( ! wp_should_load_block_editor_scripts_and_styles() ) {
wp_dequeue_script( 'jp-tracks' );
wp_dequeue_script( 'jetpack-blocks-editor' );
return;
}
$status = new Status();
// Required for Analytics. See _inc/lib/admin-pages/class.jetpack-admin-page.php.
if ( ! $status->is_offline_mode() && Jetpack::is_connection_ready() ) {
wp_enqueue_script( 'jp-tracks', '//stats.wp.com/w.js', array(), gmdate( 'YW' ), true );
}
$blocks_dir = self::get_blocks_directory();
$blocks_variation = self::blocks_variation();
if ( 'production' !== $blocks_variation ) {
$blocks_env = '-' . esc_attr( $blocks_variation );
} else {
$blocks_env = '';
}
self::register_blocks_assets_base_url();
Assets::register_script(
'jetpack-blocks-editor',
"{$blocks_dir}editor{$blocks_env}.js",
JETPACK__PLUGIN_FILE,
array(
'textdomain' => 'jetpack',
'dependencies' => array( 'jetpack-blocks-assets-base-url' ),
)
);
// Hack around #20357 (specifically, that the editor bundle depends on
// wp-edit-post but wp-edit-post's styles break the Widget Editor and
// Site Editor) until a real fix gets unblocked.
// @todo Remove this once #20357 is properly fixed.
$wp_styles_fix = wp_styles()->query( 'jetpack-blocks-editor', 'registered' );
if ( empty( $wp_styles_fix ) ) {
wp_die( 'Your installation of Jetpack is incomplete. Please run "jetpack build plugins/jetpack" in your dev env.' );
}
wp_styles()->query( 'jetpack-blocks-editor', 'registered' )->deps = array();
Assets::enqueue_script( 'jetpack-blocks-editor' );
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
$user = wp_get_current_user();
$user_data = array(
'email' => $user->user_email,
'userid' => $user->ID,
'username' => $user->user_login,
);
$blog_id = get_current_blog_id();
$is_current_user_connected = true;
} else {
$user_data = Jetpack_Tracks_Client::get_connected_user_tracks_identity();
$blog_id = Jetpack_Options::get_option( 'id', 0 );
$is_current_user_connected = ( new Connection_Manager( 'jetpack' ) )->is_user_connected();
}
if ( $blocks_variation === 'beta' && $is_current_user_connected ) {
wp_enqueue_style( 'recoleta-font', '//s1.wp.com/i/fonts/recoleta/css/400.min.css', array(), Constants::get_constant( 'JETPACK__VERSION' ) );
}
// AI Assistant
$ai_assistant_state = array(
'is-enabled' => apply_filters( 'jetpack_ai_enabled', true ),
);
$screen_base = null;
if ( function_exists( 'get_current_screen' ) ) {
$screen_base = get_current_screen()->base;
}
$modules = array();
if ( class_exists( 'Jetpack_Core_API_Module_List_Endpoint' ) ) {
$module_list_endpoint = new Jetpack_Core_API_Module_List_Endpoint();
$modules = $module_list_endpoint->get_modules();
}
$jetpack_plan = Jetpack_Plan::get();
$initial_state = array(
'available_blocks' => self::get_availability(),
'blocks_variation' => $blocks_variation,
'modules' => $modules,
'jetpack' => array(
'is_active' => Jetpack::is_connection_ready(),
'is_current_user_connected' => $is_current_user_connected,
/** This filter is documented in class.jetpack-gutenberg.php */
'enable_upgrade_nudge' => apply_filters( 'jetpack_block_editor_enable_upgrade_nudge', false ),
'is_private_site' => $status->is_private_site(),
'is_coming_soon' => $status->is_coming_soon(),
'is_offline_mode' => $status->is_offline_mode(),
'is_newsletter_feature_enabled' => class_exists( '\Jetpack_Memberships' ),
// this is the equivalent of JP initial state siteData.showMyJetpack (class-jetpack-redux-state-helper)
// used to determine if we can link to My Jetpack from the block editor
'is_my_jetpack_available' => My_Jetpack_Initializer::should_initialize(),
'jetpack_plan' => array(
'data' => $jetpack_plan['product_slug'],
),
/**
* Enable the RePublicize UI in the block editor context.
*
* @module publicize
*
* @since 10.3.0
* @deprecated 11.5 This is a feature flag that is no longer used.
*
* @param bool true Enable the RePublicize UI in the block editor context. Defaults to true.
*/
'republicize_enabled' => apply_filters( 'jetpack_block_editor_republicize_feature', true ),
),
'siteFragment' => $status->get_site_suffix(),
'adminUrl' => esc_url( admin_url() ),
'tracksUserData' => $user_data,
'wpcomBlogId' => $blog_id,
'allowedMimeTypes' => wp_get_mime_types(),
'siteLocale' => str_replace( '_', '-', get_locale() ),
'ai-assistant' => $ai_assistant_state,
'screenBase' => $screen_base,
'pluginBasePath' => plugins_url( '', Constants::get_constant( 'JETPACK__PLUGIN_FILE' ) ),
'next40pxDefaultSize' => self::site_supports_next_default_size(),
);
if ( Jetpack::is_module_active( 'publicize' ) && function_exists( 'publicize_init' ) ) {
$publicize = publicize_init();
$jetpack_social_settings = new Automattic\Jetpack\Publicize\Jetpack_Social_Settings\Settings();
$social_initial_state = $jetpack_social_settings->get_initial_state();
$initial_state['social'] = array(
'sharesData' => $publicize->get_publicize_shares_info( $blog_id ),
'hasPaidPlan' => $publicize->has_paid_plan(),
'hasPaidFeatures' => $publicize->has_paid_features(),
'isEnhancedPublishingEnabled' => $publicize->has_enhanced_publishing_feature(),
'isSocialImageGeneratorAvailable' => $social_initial_state['socialImageGeneratorSettings']['available'],
'isSocialImageGeneratorEnabled' => $social_initial_state['socialImageGeneratorSettings']['enabled'],
'dismissedNotices' => Dismissed_Notices::get_dismissed_notices(),
'supportedAdditionalConnections' => $publicize->get_supported_additional_connections(),
'jetpackSharingSettingsUrl' => esc_url_raw( admin_url( 'admin.php?page=jetpack#/sharing' ) ),
'userConnectionUrl' => esc_url_raw( admin_url( 'admin.php?page=my-jetpack#/connection' ) ),
'useAdminUiV1' => $social_initial_state['useAdminUiV1'],
);
// Add connectionData if we are using the new Connection UI.
if ( $social_initial_state['useAdminUiV1'] ) {
$initial_state['social']['connectionData'] = $social_initial_state['connectionData'];
$initial_state['social']['connectionRefreshPath'] = $social_initial_state['connectionRefreshPath'];
}
$initial_state['social']['featureFlags'] = $social_initial_state['featureFlags'];
}
wp_localize_script(
'jetpack-blocks-editor',
'Jetpack_Editor_Initial_State',
$initial_state
);
// Adds Connection package initial state.
Connection_Initial_State::render_script( 'jetpack-blocks-editor' );
}
/**
* Some blocks do not depend on a specific module,
* and can consequently be loaded outside of the usual modules.
* We will look for such modules in the extensions/ directory.
*
* @since 7.1.0
* @see wp_common_block_scripts_and_styles()
*/
public static function load_independent_blocks() {
if ( self::should_load() ) {
/**
* Look for files that match our list of available Jetpack Gutenberg extensions (blocks and plugins).
* If available, load them.
*/
$directories = array( 'blocks', 'plugins', 'extended-blocks', 'shared', 'store' );
foreach ( static::get_extensions() as $extension ) {
foreach ( $directories as $dirname ) {
$path = JETPACK__PLUGIN_DIR . "extensions/{$dirname}/{$extension}/{$extension}.php";
if ( file_exists( $path ) ) {
include_once $path;
continue 2;
}
}
}
}
}
/**
* Loads PHP components of block editor extensions.
*
* @since 8.9.0
*/
public static function load_block_editor_extensions() {
if ( self::should_load() ) {
// Block editor extensions to load.
$extensions_to_load = array(
'extended-blocks',
'plugins',
);
// Collect the extension paths.
foreach ( $extensions_to_load as $extension_to_load ) {
$extensions_folder = glob( JETPACK__PLUGIN_DIR . 'extensions/' . $extension_to_load . '/*' );
// Require each of the extension files, in case it exists.
foreach ( $extensions_folder as $extension_folder ) {
$name = basename( $extension_folder );
$extension_file_path = JETPACK__PLUGIN_DIR . 'extensions/' . $extension_to_load . '/' . $name . '/' . $name . '.php';
if ( file_exists( $extension_file_path ) ) {
include_once $extension_file_path;
}
}
}
}
}
/**
* Determine whether a site should use the default set of blocks, or a custom set.
* Possible variations are currently beta, experimental, and production.
*
* @since 8.1.0
*
* @return string $block_varation production|beta|experimental
*/
public static function blocks_variation() {
// Default to production blocks.
$block_varation = 'production';
/*
* Prefer to use this JETPACK_BLOCKS_VARIATION constant
* or the jetpack_blocks_variation filter
* to set the block variation in your code.
*/
$default = Constants::get_constant( 'JETPACK_BLOCKS_VARIATION' );
if ( ! empty( $default ) && in_array( $default, array( 'beta', 'experimental', 'production' ), true ) ) {
$block_varation = $default;
}
/**
* Alternative to `JETPACK_BETA_BLOCKS`, set to `true` to load Beta Blocks.
*
* @since 6.9.0
* @deprecated 11.8.0 Use jetpack_blocks_variation filter instead.
*
* @param boolean
*/
$is_beta = apply_filters_deprecated(
'jetpack_load_beta_blocks',
array( false ),
'jetpack-11.8.0',
'jetpack_blocks_variation'
);
/*
* Switch to beta blocks if you use the JETPACK_BETA_BLOCKS constant
* or the deprecated jetpack_load_beta_blocks filter.
* This only applies when not using the newer JETPACK_BLOCKS_VARIATION constant.
*/
if (
empty( $default )
&& (
$is_beta
|| Constants::is_true( 'JETPACK_BETA_BLOCKS' )
)
) {
$block_varation = 'beta';
}
/**
* Alternative to `JETPACK_EXPERIMENTAL_BLOCKS`, set to `true` to load Experimental Blocks.
*
* @since 6.9.0
* @deprecated 11.8.0 Use jetpack_blocks_variation filter instead.
*
* @param boolean
*/
$is_experimental = apply_filters_deprecated(
'jetpack_load_experimental_blocks',
array( false ),
'jetpack-11.8.0',
'jetpack_blocks_variation'
);
/*
* Switch to experimental blocks if you use the JETPACK_EXPERIMENTAL_BLOCKS constant
* or the deprecated jetpack_load_experimental_blocks filter.
* This only applies when not using the newer JETPACK_BLOCKS_VARIATION constant.
*/
if (
empty( $default )
&& (
$is_experimental
|| Constants::is_true( 'JETPACK_EXPERIMENTAL_BLOCKS' )
)
) {
$block_varation = 'experimental';
}
/**
* Allow customizing the variation of blocks in use on a site.
* Overwrites any previously set values, whether by constant or filter.
*
* @since 8.1.0
*
* @param string $block_variation Can be beta, experimental, and production. Defaults to production.
*/
return apply_filters( 'jetpack_blocks_variation', $block_varation );
}
/**
* Get a list of extensions available for the variation you chose.
*
* @since 8.1.0
*
* @param object $preset_extensions_manifest List of extensions available in Jetpack.
* @param string $blocks_variation Subset of blocks. production|beta|experimental.
*
* @return array $preset_extensions Array of extensions for that variation
*/
public static function get_extensions_preset_for_variation( $preset_extensions_manifest, $blocks_variation ) {
$preset_extensions = isset( $preset_extensions_manifest->{ $blocks_variation } )
? (array) $preset_extensions_manifest->{ $blocks_variation }
: array();
/*
* Experimental and Beta blocks need the production blocks as well.
*/
if (
'experimental' === $blocks_variation
|| 'beta' === $blocks_variation
) {
$production_extensions = isset( $preset_extensions_manifest->production )
? (array) $preset_extensions_manifest->production
: array();
$preset_extensions = array_unique( array_merge( $preset_extensions, $production_extensions ) );
}
/*
* Beta blocks need the experimental blocks as well.
*
* If you've chosen to see Beta blocks,
* we want to make all blocks available to you:
* - Production
* - Experimental
* - Beta
*/
if ( 'beta' === $blocks_variation ) {
$production_extensions = isset( $preset_extensions_manifest->experimental )
? (array) $preset_extensions_manifest->experimental
: array();
$preset_extensions = array_unique( array_merge( $preset_extensions, $production_extensions ) );
}
return $preset_extensions;
}
/**
* Validate a URL used in a SSR block.
*
* @since 8.3.0
*
* @param string $url URL saved as an attribute in block.
* @param array $allowed Array of allowed hosts for that block, or regexes to check against.
* @param bool $is_regex Array of regexes matching the URL that could be used in block.
*
* @return bool|string
*/
public static function validate_block_embed_url( $url, $allowed = array(), $is_regex = false ) {
if (
empty( $url )
|| ! is_array( $allowed )
|| empty( $allowed )
) {
return false;
}
$url_components = wp_parse_url( $url );
// Bail early if we cannot find a host.
if ( empty( $url_components['host'] ) ) {
return false;
}
// Normalize URL.
$url = sprintf(
'%s://%s%s%s',
isset( $url_components['scheme'] ) ? $url_components['scheme'] : 'https',
$url_components['host'],
isset( $url_components['path'] ) ? $url_components['path'] : '/',
isset( $url_components['query'] ) ? '?' . $url_components['query'] : ''
);
if ( ! empty( $url_components['fragment'] ) ) {
$url = $url . '#' . rawurlencode( $url_components['fragment'] );
}
/*
* If we're using an allowed list of hosts,
* check if the URL belongs to one of the domains allowed for that block.
*/
if (
false === $is_regex
&& in_array( $url_components['host'], $allowed, true )
) {
return $url;
}
/*
* If we are using an array of regexes to check against,
* loop through that.
*/
if ( true === $is_regex ) {
foreach ( $allowed as $regex ) {
if ( 1 === preg_match( $regex, $url ) ) {
return $url;
}
}
}
return false;
}
/**
* Determines whether a preview of the block with an upgrade nudge should
* be displayed for admins on the site frontend.
*
* @since 8.4.0
*
* @param array $availability_for_block The availability for the block.
*
* @return bool
*/
public static function should_show_frontend_preview( $availability_for_block ) {
return (
isset( $availability_for_block['details']['required_plan'] )
&& current_user_can( 'manage_options' )
&& ! is_feed()
);
}
/**
* Output an UpgradeNudge Component on the frontend of a site.
*
* @since 8.4.0
*
* @param string $plan The plan that users need to purchase to make the block work.
*
* @return string
*/
public static function upgrade_nudge( $plan ) {
require_once JETPACK__PLUGIN_DIR . '_inc/lib/components.php';
return Jetpack_Components::render_upgrade_nudge(
array(
'plan' => $plan,
)
);
}
/**
* Output a notice within a block.
*
* @since 8.6.0
*
* @param string $message Notice we want to output.
* @param string $status Status of the notice. Can be one of success, info, warning, error. info by default.
* @param string $classes List of CSS classes.
*
* @return string
*/
public static function notice( $message, $status = 'info', $classes = '' ) {
if (
empty( $message )
|| ! in_array( $status, array( 'success', 'info', 'warning', 'error' ), true )
) {
return '';
}
$color = '';
switch ( $status ) {
case 'success':
$color = '#00a32a';
break;
case 'warning':
$color = '#dba617';
break;
case 'error':
$color = '#d63638';
break;
case 'info':
default:
$color = '#72aee6';
break;
}
return sprintf(
'
%2$s
',
esc_attr( $status ),
wp_kses(
$message,
array(
'br' => array(),
'p' => array(),
'a' => array(
'href' => array(),
'target' => array(),
'rel' => array(),
),
)
),
esc_attr( $classes ),
sanitize_hex_color( $color )
);
}
/**
* Retrieve site-specific features for Simple sites.
*
* We're caching the data for the lifetime of the request, because it can be slow to calculate,
* and it can be called multiple times per single request.
*
* We intentionally don't use object caching or any other type of persistent caching,
* in order to avoid complex cache invalidation on subscription addition or removal.
*
* @since 10.7
*
* @return array
*/
private static function get_site_specific_features() {
$current_blog_id = get_current_blog_id();
if ( isset( self::$site_specific_features[ $current_blog_id ] ) ) {
return self::$site_specific_features[ $current_blog_id ];
}
if ( ! class_exists( 'Store_Product_List' ) ) {
require WP_CONTENT_DIR . '/admin-plugins/wpcom-billing/store-product-list.php';
}
$site_specific_features = Store_Product_List::get_site_specific_features_data( $current_blog_id );
self::$site_specific_features[ $current_blog_id ] = $site_specific_features;
return $site_specific_features;
}
/**
* Set the availability of the block as the editor
* is loaded.
*
* @param string $slug Slug of the block.
*/
public static function set_availability_for_plan( $slug ) {
$slug = self::remove_extension_prefix( $slug );
if ( Jetpack_Plan::supports( $slug ) ) {
self::set_extension_available( $slug );
return;
}
// Check what's the minimum plan where the feature is available.
$plan = '';
$features_data = array();
$is_simple_site = defined( 'IS_WPCOM' ) && IS_WPCOM;
$is_atomic_site = ( new Host() )->is_woa_site();
if ( $is_simple_site || $is_atomic_site ) {
// Simple sites.
if ( $is_simple_site ) {
$features_data = self::get_site_specific_features();
} else {
// Atomic sites.
$option = get_option( 'jetpack_active_plan' );
if ( isset( $option['features'] ) ) {
$features_data = $option['features'];
}
}
if ( ! empty( $features_data['available'][ $slug ] ) ) {
$plan = $features_data['available'][ $slug ][0];
}
} else {
// Jetpack sites.
$plan = Jetpack_Plan::get_minimum_plan_for_feature( $slug );
}
self::set_extension_unavailable(
$slug,
'missing_plan',
array(
'required_feature' => $slug,
'required_plan' => $plan,
)
);
}
/**
* Wraps the suplied render_callback in a function to check
* the availability of the block before rendering it.
*
* @param string $slug The block slug, used to check for availability.
* @param callable $render_callback The render_callback that will be called if the block is available.
*/
public static function get_render_callback_with_availability_check( $slug, $render_callback ) {
return function ( $prepared_attributes, $block_content, $block ) use ( $render_callback, $slug ) {
$availability = self::get_cached_availability();
$bare_slug = self::remove_extension_prefix( $slug );
if ( isset( $availability[ $bare_slug ] ) && $availability[ $bare_slug ]['available'] ) {
return call_user_func( $render_callback, $prepared_attributes, $block_content );
}
// A preview of the block is rendered for admins on the frontend with an upgrade nudge.
if ( isset( $availability[ $bare_slug ] ) ) {
if ( self::should_show_frontend_preview( $availability[ $bare_slug ] ) ) {
$block_preview = call_user_func( $render_callback, $prepared_attributes, $block_content );
// If the upgrade nudge isn't already being displayed by a parent block, display the nudge.
if ( isset( $block->attributes['shouldDisplayFrontendBanner'] ) && $block->attributes['shouldDisplayFrontendBanner'] ) {
$upgrade_nudge = self::upgrade_nudge( $availability[ $bare_slug ]['details']['required_plan'] );
return $upgrade_nudge . $block_preview;
}
return $block_preview;
}
}
return null;
};
}
/**
* Display a message to site editors and roles above when a block is no longer supported.
* This is only displayed on the frontend.
*
* @since 12.3
*
* @param string $block_content The block content.
* @param array $block The full block, including name and attributes.
*
* @return string
*/
public static function display_deprecated_block_message( $block_content, $block ) {
if ( in_array( $block['blockName'], self::$deprecated_blocks, true ) ) {
if ( current_user_can( 'edit_posts' ) ) {
$block_content = self::notice(
__( 'This block is no longer supported. Its contents will no longer be displayed to your visitors and as such this block should be removed.', 'jetpack' ),
'warning',
'jetpack-block-deprecated'
);
} else {
$block_content = '';
}
}
return $block_content;
}
/**
* Check whether the environment supports the newer default size of elements, gradually introduced starting with WP 6.4.
*
* @since 14.0
*
* @see https://make.wordpress.org/core/2023/10/16/editor-components-updates-in-wordpress-6-4/#improving-size-consistency-for-ui-components
*
* @to-do: Deprecate this method and the logic around it when Jetpack requires WordPress 6.7.
*
* @return bool
*/
public static function site_supports_next_default_size() {
/*
* If running a local dev build of gutenberg,
* let's assume it supports the newest changes included in Gutenberg.
*/
if ( defined( 'GUTENBERG_DEVELOPMENT_MODE' ) && GUTENBERG_DEVELOPMENT_MODE ) {
return true;
}
// Let's now check if the Gutenberg plugin is installed on the site.
if (
defined( 'GUTENBERG_VERSION' )
&& version_compare( GUTENBERG_VERSION, '19.4', '>=' )
) {
return true;
}
// Finally, let's check for the WordPress version.
global $wp_version;
if ( version_compare( $wp_version, '6.7', '>=' ) ) {
return true;
}
// Final fallback.
return false;
}
/**
* Temporarily bypasses _doing_it_wrong() notices for block metadata collection registration.
*
* WordPress 6.7 introduced block metadata collections (with strict path validation).
* Any sites using symlinks for plugins will fail the validation which causes the metadata
* collection to not be registered. However, the blocks will still fall back to the regular
* registration and no functionality is affected.
* While this validation is being discussed in WordPress Core (#62140),
* this method allows registration to proceed by temporarily disabling
* the relevant notice.
*
* @since 14.2
*
* @param bool $trigger Whether to trigger the error.
* @param string $function The function that was called.
* @param string $message A message explaining what was done incorrectly.
* @param string $version The version of WordPress where the message was added.
* @return bool Whether to trigger the error.
*/
public static function bypass_block_metadata_doing_it_wrong( $trigger, $function, $message, $version ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
if ( $function === 'WP_Block_Metadata_Registry::register_collection' ) {
return false;
}
return $trigger;
}
/**
* Register block metadata collection for Jetpack blocks.
* This allows for more efficient block metadata loading by avoiding
* individual block.json file reads at runtime.
*
* Uses wp_register_block_metadata_collection() if available (WordPress 6.7+)
* and if the manifest file exists. The manifest file is auto-generated
* during the build process.
*
* Runs on plugins_loaded to ensure registration happens before individual
* blocks register themselves on init.
*
* @static
* @since 14.1
* @return void
*/
public static function register_block_metadata_collection() {
$meta_file_path = JETPACK__PLUGIN_DIR . '_inc/blocks/blocks-manifest.php';
if ( function_exists( 'wp_register_block_metadata_collection' ) && file_exists( $meta_file_path ) ) {
add_filter( 'doing_it_wrong_trigger_error', array( __CLASS__, 'bypass_block_metadata_doing_it_wrong' ), 10, 4 );
// @phan-suppress-next-line PhanUndeclaredFunction -- New in WP 6.7. We're checking if it exists first. @phan-suppress-current-line UnusedPluginSuppression
wp_register_block_metadata_collection(
JETPACK__PLUGIN_DIR . '_inc/blocks/',
$meta_file_path
);
remove_filter( 'doing_it_wrong_trigger_error', array( __CLASS__, 'bypass_block_metadata_doing_it_wrong' ), 10 );
}
}
}
if ( ( new Host() )->is_woa_site() ) {
/**
* Enable upgrade nudge for Atomic sites.
* This feature is false as default,
* so let's enable it through this filter.
*
* More doc: https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/extensions/README.md#upgrades-for-blocks
*/
add_filter( 'jetpack_block_editor_enable_upgrade_nudge', '__return_true' );
}