Skip to content

Commit 416b149

Browse files
committed
Ensure Required WP version is updated when readme is updated.
1 parent f3d352a commit 416b149

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

includes/create-theme/theme-readme.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public static function update( $theme, $readme_content = '' ) {
210210
$description = $theme['description'] ?? '';
211211
$author = $theme['author'] ?? '';
212212
$wp_version = $theme['wp_version'] ?? CBT_Theme_Utils::get_current_wordpress_version();
213+
$wp_min = $theme['requires_wp'] ?? CBT_Theme_Utils::get_current_wordpress_version();
213214
$image_credits = $theme['image_credits'] ?? '';
214215
$recommended_plugins = $theme['recommended_plugins'] ?? '';
215216
$font_credits = $theme['font_credits'] ?? '';
@@ -220,6 +221,9 @@ public static function update( $theme, $readme_content = '' ) {
220221
// Update Author/Contributors.
221222
$readme_content = self::add_or_update_prop( 'Contributors', $author, $readme_content );
222223

224+
// Update Required WordPress version.
225+
$readme_content = self::add_or_update_prop( 'Requires at least', $wp_min, $readme_content );
226+
223227
// Update "Tested up to" version.
224228
$readme_content = self::add_or_update_prop( 'Tested up to', $wp_version, $readme_content );
225229

0 commit comments

Comments
 (0)