From e100a2a709ce9e7104ba2ec2e1e826e55551c0a1 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Sun, 26 Oct 2025 16:38:07 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feature:=20Update=20"Theme=20name:"=20?= =?UTF-8?q?in=20style.css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- windows/wp-bootstrap.ps1 | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/windows/wp-bootstrap.ps1 b/windows/wp-bootstrap.ps1 index fef67ce..505f1a1 100644 --- a/windows/wp-bootstrap.ps1 +++ b/windows/wp-bootstrap.ps1 @@ -270,10 +270,28 @@ if (Test-Path "$ThemeDir\.git") { Remove-Item -Recurse -Force "$ThemeDir\.git" } Invoke-WP "theme" "activate" "$Slug" +# --- Stamp Theme Name + Text Domain into style.css --- +$styleCss = Join-Path $ThemeDir "style.css" +$TextDomain = "$Slug" # matches your theme folder name +if (Test-Path $styleCss) { + $css = Get-Content $styleCss -Raw + + # Replace existing "Theme Name:" line (supports plain or "* Theme Name:" formats) + $css = [regex]::Replace( + $css, + '(?im)^(?:\s*\*\s*)?Theme\s+Name\s*:\s*.*$', + " * Theme Name: $ProjectName" + ) + + Set-Content -Path $styleCss -Value $css -Encoding UTF8 + Write-Host "Updated style.css header with Theme Name: $ProjectName" +} + Push-Location $ThemeDir -# ---- Init theme dependencies ---- +# ---- Init theme dependencies and build Tailwind ---- composer install 2>$null npm install 2>$null +npm run build 2>$null # ---- Init new git repo ---- git init -b main | Out-Null @@ -321,6 +339,7 @@ Project: $ProjectName Slug: $Slug Folder: $ProjectDir Local URL: $LocalUrl +Local Admin URL: $LocalUrl/wp-admin/ DB Host: $MysqlHost DB Port: $MysqlPort