diff --git a/README.md b/README.md index d361120..fb40487 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,9 @@ Source: https://pixabay.com/en/coffee-book-flowers-setting-2390136/ Unless otherwise specified, all the theme files, scripts and images including the screenshot image are licensed under [GNU GPL] (http://www.gnu.org/licenses/gpl-3.0.txt), version 3 or later. == Changelog == += TBD = +* Fix - Theme name and version in the admin dashboard while child theme active. + = Version 1.3.3 - 2020-02-27 = * Tweak - Refactor theme page according to WordPress theme guidelines diff --git a/inc/admin/class-flash-dashboard.php b/inc/admin/class-flash-dashboard.php index 5b4ac12..01eef8a 100644 --- a/inc/admin/class-flash-dashboard.php +++ b/inc/admin/class-flash-dashboard.php @@ -29,7 +29,12 @@ public function enqueue_scripts() { } public function create_menu() { - $theme = wp_get_theme(); + + if ( is_child_theme() ) { + $theme = wp_get_theme()->parent(); + } else { + $theme = wp_get_theme(); + } /* translators: %s: Theme Name. */ $theme_page_name = sprintf( esc_html__( '%s Options', 'flash' ), $theme->Name ); @@ -47,14 +52,19 @@ public function enqueue_styles() { } public function option_page() { - $theme = wp_get_theme(); + + if ( is_child_theme() ) { + $theme = wp_get_theme()->parent(); + } else { + $theme = wp_get_theme(); + } ?>