From 13ef88bf7a84ef121104ed8bf3430e49bdc1d94d Mon Sep 17 00:00:00 2001 From: DustyReagan Date: Fri, 2 Aug 2024 16:15:57 -0500 Subject: [PATCH 1/2] Check admin interface inside function call --- .../src/features/wpcom-themes/wpcom-themes.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/wpcom-themes.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/wpcom-themes.php index f41d700df1a21..d8d25b497f141 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/wpcom-themes.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/wpcom-themes.php @@ -9,14 +9,14 @@ use Automattic\Jetpack\Jetpack_Mu_Wpcom; -if ( get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) { - return; -} - /** * Displays a banner before the theme browser that links to the WP.com Theme Showcase. */ function wpcom_themes_show_banner() { + if ( get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) { + return; + } + $site_slug = wp_parse_url( home_url(), PHP_URL_HOST ); $wpcom_logo = plugins_url( 'images/wpcom-logo.svg', __FILE__ ); $background_image = plugins_url( 'images/banner-background.webp', __FILE__ ); @@ -56,6 +56,10 @@ function wpcom_themes_show_banner() { * Registers an "Appearance > Theme Showcase" menu. */ function wpcom_themes_add_theme_showcase_menu() { + if ( get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) { + return; + } + $site_slug = wp_parse_url( home_url(), PHP_URL_HOST ); add_submenu_page( 'themes.php', From 549ff00aaa9707fdd2e5c5c479ff4bc08a1bf56f Mon Sep 17 00:00:00 2001 From: DustyReagan Date: Fri, 2 Aug 2024 16:16:58 -0500 Subject: [PATCH 2/2] changelog --- .../jetpack-mu-wpcom/changelog/fix-simple-theme-showcase-menu | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/fix-simple-theme-showcase-menu diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-simple-theme-showcase-menu b/projects/packages/jetpack-mu-wpcom/changelog/fix-simple-theme-showcase-menu new file mode 100644 index 0000000000000..fa79431450512 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-simple-theme-showcase-menu @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix bug so Theme Showcase menu appears on Simple Classic sites