Skip to content

Commit

Permalink
Add a minimum required version if none exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Sep 4, 2024
1 parent 2b4f79a commit f13a3ea
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions includes/create-theme/theme-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@ public static function update_style_css( $style_css, $theme ) {
$author_uri = $theme['author_uri'];
$wp_version = CBT_Theme_Utils::get_current_wordpress_version();
$wp_min = $current_theme->get( 'RequiresWP' );
$version = $theme['version'];
$requires_php = $current_theme->get( 'RequiresPHP' );
$text_domain = $theme['slug'];
$template = $current_theme->get( 'Template' ) ? "\n" . 'Template: ' . $current_theme->get( 'Template' ) : '';
$license = $style_data['License'] ? $style_data['License'] : 'GNU General Public License v2 or later';
$license_uri = $style_data['LicenseURI'] ? $style_data['LicenseURI'] : 'http://www.gnu.org/licenses/gpl-2.0.html';
$tags = CBT_Theme_Tags::theme_tags_list( $theme );
$css_contents = $css_contents ? "\n\n" . $css_contents : '';
$copyright = '';
if ( ! $wp_min ) {
$wp_min = '5.9';
}
$version = $theme['version'];
$requires_php = $current_theme->get( 'RequiresPHP' );
$text_domain = $theme['slug'];
$template = $current_theme->get( 'Template' ) ? "\n" . 'Template: ' . $current_theme->get( 'Template' ) : '';
$license = $style_data['License'] ? $style_data['License'] : 'GNU General Public License v2 or later';
$license_uri = $style_data['LicenseURI'] ? $style_data['LicenseURI'] : 'http://www.gnu.org/licenses/gpl-2.0.html';
$tags = CBT_Theme_Tags::theme_tags_list( $theme );
$css_contents = $css_contents ? "\n\n" . $css_contents : '';
$copyright = '';
preg_match( '/^\s*\n((?s).*?)\*\/\s*$/m', $style_css, $matches );
if ( isset( $matches[1] ) ) {
$copyright = "\n" . $matches[1];
Expand Down

0 comments on commit f13a3ea

Please sign in to comment.