get( 'Name' ); $current_theme_v = $theme->get( 'Version' ); $parent_theme = $theme->parent(); // Set required version for each theme $my_themes = array( 'Docy' => '4.4.0', 'Docly' => '2.3.2', 'Ama' => '1.7.1', ); foreach ( $my_themes as $name => $required_v ) { // Check if theme name contains one of our themes if ( stripos( $theme_name, $name ) !== false ) { // Don't show notice if a child theme is active and parent theme meets the required version if ( $parent_theme ) { $parent_theme_name = $parent_theme->get( 'Name' ); $parent_theme_version = $parent_theme->get( 'Version' ); // If parent theme matches and meets the required version, don't show the notice if ( $name === $parent_theme_name && version_compare( $parent_theme_version, $required_v, '>=' ) ) { return; // Don't show the notice } } // Check if current version is less than required version if ( version_compare( $current_theme_v, $required_v, '<' ) ) { ?>