Skip to content

Instantly share code, notes, and snippets.

@BrookeDot
Created November 19, 2017 00:00
Show Gist options
  • Save BrookeDot/b071e36a4ba757aab672705f5bc0dfb4 to your computer and use it in GitHub Desktop.
Save BrookeDot/b071e36a4ba757aab672705f5bc0dfb4 to your computer and use it in GitHub Desktop.
Check if using a child theme before comparing version of GPP themes
@@ -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