diff --git a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php index 36cf05aa3c39b..36272bb426854 100644 --- a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php +++ b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php @@ -128,6 +128,7 @@ public static function load_wpcom_user_features() { require_once __DIR__ . '/features/wpcom-admin-interface/wpcom-admin-interface.php'; require_once __DIR__ . '/features/wpcom-admin-menu/wpcom-admin-menu.php'; require_once __DIR__ . '/features/wpcom-command-palette/wpcom-command-palette.php'; + require_once __DIR__ . '/features/wpcom-plugins/wpcom-plugins.php'; require_once __DIR__ . '/features/wpcom-sidebar-notice/wpcom-sidebar-notice.php'; require_once __DIR__ . '/features/wpcom-site-management-widget/class-wpcom-site-management-widget.php'; require_once __DIR__ . '/features/wpcom-themes/wpcom-themes.php'; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-plugins/wpcom-plugins.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-plugins/wpcom-plugins.php new file mode 100644 index 0000000000000..e88ac0981a177 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-plugins/wpcom-plugins.php @@ -0,0 +1,61 @@ + 'defer', + 'in_footer' => true, + ) + ); + wp_localize_script( + 'wpcom-plugins-banner', + 'wpcomPluginsBanner', + array( + 'logo' => esc_url( $wpcom_logo ), + 'title' => esc_html__( "Flex your site's features with plugins", 'jetpack-mu-wpcom' ), + 'description' => esc_html__( "Access a variety of free and paid plugins that can enhance your site's functionality and features.", 'jetpack-mu-wpcom' ), + 'actionUrl' => esc_url( "https://wordpress.com/plugins/$site_slug?ref=woa-plugin-banner" ), + 'actionText' => esc_html__( 'Explore plugins', 'jetpack-mu-wpcom' ), + 'bannerBackground' => esc_url( $background_image ), + ) + ); + wp_enqueue_style( + 'wpcom-plugins-banner', + plugins_url( 'css/banner.css', __FILE__ ), + array(), + WPCOMSH_VERSION + ); +} +add_action( 'load-plugin-install.php', 'wpcom_plugins_show_banner' ); diff --git a/projects/plugins/wpcomsh/wpcom-plugins/plugins.php b/projects/plugins/wpcomsh/wpcom-plugins/plugins.php index f03ab13f22662..f036845c79301 100644 --- a/projects/plugins/wpcomsh/wpcom-plugins/plugins.php +++ b/projects/plugins/wpcomsh/wpcom-plugins/plugins.php @@ -58,4 +58,3 @@ function wpcomsh_plugins_show_banner() { WPCOMSH_VERSION, ); } -add_action( 'load-plugin-install.php', 'wpcomsh_plugins_show_banner' );