Skip to content

Local Environment: Theme Directory#563

Draft
dd32 wants to merge 5 commits intoWordPress:trunkfrom
dd32:create/claude/theme-directory-wp-env
Draft

Local Environment: Theme Directory#563
dd32 wants to merge 5 commits intoWordPress:trunkfrom
dd32:create/claude/theme-directory-wp-env

Conversation

@dd32
Copy link
Member

@dd32 dd32 commented Mar 16, 2026

No description provided.

dd32 and others added 5 commits March 16, 2026 15:56
Adds a wp-env based local environment for the Theme Directory, following
the same pattern as the Plugin Directory environment.

Environment setup:
- Theme directory plugin from this repository
- wporg-themes-2024 theme and wporg-ratings plugin from WordPress/wporg-theme-directory
- wporg-parent-2021 theme
- Shared mu-plugin mocks (query filter, dev login, mu-plugins loader)
- Stub tables for bb_themes_stats and ratings

On first start:
- Creates pages (commercial, getting-started, upload)
- Creates business model taxonomy terms
- Imports ~45 themes from WordPress.org API (popular, new, updated)

Usage:
  cd environments && npm install
  npm run themes:env start

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
wp-env does not support subdirectory references within GitHub repos.
Map the wporg-theme-directory repo and symlink the theme in after-start.
Add a stub wporg-ratings mu-plugin for local development.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The _screenshot post meta is expected to be a version-keyed array
(e.g. ['1.4' => 'screenshot.png']), not a plain URL string. This was
causing a fatal on browse pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Storing all historical versions caused latest_version() to return the
oldest version (via array_search on a sorted array), which had no
matching screenshot entry, producing warnings on browse pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d of symlinks.

Use the build branch of WordPress/wporg-theme-directory which includes
compiled assets, fixing the block namespace notice. Replace symlinks
with a mu-plugin that calls register_theme_directory() for cleaner
theme discovery.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant