Skip to content

Commit

Permalink
Admin menu: Fix "Appearance > Themes" menu for WP.com classic sites (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtr authored Apr 17, 2024
1 parent f56c7a4 commit 2874c2e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed a WP.com only issue that forced the Themes menu to always point to Calypso even when the classic interface was set
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ function wpcom_themes_add_theme_showcase_menu() {
return;
}

// Bail on Simple sites, since "Appearance > Themes" already links to the Theme Showcase on those.
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
return;
}

$site_slug = wp_parse_url( home_url(), PHP_URL_HOST );
add_submenu_page( 'themes.php', esc_attr__( 'Theme Showcase', 'jetpack-mu-wpcom' ), __( 'Theme Showcase', 'jetpack-mu-wpcom' ), 'read', "https://wordpress.com/themes/$site_slug?ref=wpcom-themes-menu" );
}
Expand Down
5 changes: 5 additions & 0 deletions projects/plugins/jetpack/changelog/fix-theme-showcase-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Fixed a WP.com only issue that forced the Themes menu to always point to Calypso even when the classic interface was set


Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function add_appearance_menu() {
$default_customize_background_slug_2 => add_query_arg( array( 'autofocus' => array( 'section' => 'colors_manager_tool' ) ), $customize_url ),
);

if ( self::DEFAULT_VIEW === $this->get_preferred_view( 'themes.php' ) || self::CLASSIC_VIEW === $this->get_preferred_view( 'themes.php' ) ) {
if ( self::DEFAULT_VIEW === $this->get_preferred_view( 'themes.php' ) ) {
$submenus_to_update['themes.php'] = 'https://wordpress.com/themes/' . $this->domain;
}

Expand Down

0 comments on commit 2874c2e

Please sign in to comment.