Jelajahi Sumber

Deploy: Use the requirement rather than the tested version (#5235)

Ben Dwyer 3 tahun lalu
induk
melakukan
68715b8323
1 mengubah file dengan 3 tambahan dan 4 penghapusan
  1. 3 4
      theme-utils.mjs

+ 3 - 4
theme-utils.mjs

@@ -191,7 +191,7 @@ async function buildComZip(themeSlug) {
 
 	// Gets the theme version (Version:) and minimum WP version (Tested up to:) from the theme's style.css
 	let themeVersion = getThemeMetadata(styleCss, 'Version');
-	let wpVersionCompat = getThemeMetadata(styleCss, 'Tested up to');
+	let wpVersionCompat = getThemeMetadata(styleCss, 'Requires at least');
 
 	if (themeVersion && wpVersionCompat) {
 		await executeOnSandbox(`php ${sandboxRootFolder}bin/themes/theme-downloads/build-theme-zip.php --stylesheet=pub/${themeSlug} --themeversion=${themeVersion} --wpversioncompat=${wpVersionCompat}`, true);
@@ -379,9 +379,9 @@ function getThemeMetadata(styleCss, attribute) {
 				.match(/(?<=Version:\s*).*?(?=\s*\r?\n|\rg)/gs)[0]
 				.trim()
 				.replace('-wpcom', '');
-		case 'Tested up to':
+		case 'Requires at least':
 			return styleCss
-				.match(/(?<=Tested up to:\s*).*?(?=\s*\r?\n|\rg)/gs);
+				.match(/(?<=Requires at least:\s*).*?(?=\s*\r?\n|\rg)/gs);
 	}
 }
 
@@ -838,4 +838,3 @@ async function executeCommand(command, logResponse) {
 		});
 	});
 }
-