From 763ac66754b887a7f16aa043ba1edec8297a7a49 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 3 Aug 2017 13:49:43 +0000 Subject: [PATCH] Networks and Sites: Display an indicator for the active theme or child theme when viewing a site's themes within Network Admin. Props palmiak, euthelup Fixes #41168 Built from https://develop.svn.wordpress.org/trunk@41214 git-svn-id: http://core.svn.wordpress.org/trunk@41054 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../class-wp-ms-themes-list-table.php | 21 ++++++++++++++++++- wp-includes/version.php | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-ms-themes-list-table.php b/wp-admin/includes/class-wp-ms-themes-list-table.php index d2a2203056..fb3c33e7ad 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -618,7 +618,26 @@ class WP_MS_Themes_List_Table extends WP_List_Table { break; case 'name': - echo "" . $item->display('Name') . ""; + + $active_theme_label = ''; + + /* The presence of the site_id property means that this is a subsite view and a label for the active theme needs to be added */ + if ( ! empty( $this->site_id ) ) { + $stylesheet = get_blog_option( $this->site_id, 'stylesheet' ); + $template = get_blog_option( $this->site_id, 'template' ); + + /* Add a label for the active template */ + if ( $item->get_template() === $template ) { + $active_theme_label = ' — ' . __( 'Active Theme' ); + } + + /* In case this is a child theme, label it properly */ + if ( $stylesheet !== $template && $item->get_stylesheet() === $stylesheet) { + $active_theme_label = ' — ' . __( 'Active Child Theme' ); + } + } + + echo "" . $item->display( 'Name' ) . $active_theme_label . ''; $this->column_name( $item ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 011fe71cb6..42fc8c273b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41213'; +$wp_version = '4.9-alpha-41214'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.