Created
November 19, 2017 00:00
-
-
Save BrookeDot/b071e36a4ba757aab672705f5bc0dfb4 to your computer and use it in GitHub Desktop.
Check if using a child theme before comparing version of GPP themes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -523,8 +524,13 @@ | |
private function get_local_version() { | |
if ( $this->is_theme() ) { | |
$theme_data = wp_get_theme(); | |
- | |
- return $theme_data->Version; | |
+ if( $theme_data->parent() ){ | |
+ $parent_theme_data = wp_get_theme( $theme_data->Template ); | |
+ return $parent_theme_data->Version; | |
+ } | |
+ else{ | |
+ return $theme_data->Version; | |
+ } | |
} else { | |
$plugin_data = get_plugin_data( $this->plugin_file, false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment