Skip to content

Add wp theme cache command - #494

Draft
swissspidy with Copilot wants to merge 13 commits into
mainfrom
copilot/add-wp-theme-cache-command
Draft

Add wp theme cache command#494
swissspidy with Copilot wants to merge 13 commits into
mainfrom
copilot/add-wp-theme-cache-command

Conversation

CopilotAI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor
  • Create Theme_Cache_Command.php class with clear and flush methods
  • Register 'theme cache' command in extension-command.php
  • Add Behat tests for theme cache commands
  • Update phpcs.xml.dist to exclude Theme_Cache_Command from prefix rule
  • Update composer.json with new commands
  • Verify code passes linting, code style, and static analysis checks
  • Run code review and security checks
  • Use WP_Theme::cache_delete() method instead of manual cache key construction
  • Implementation complete and ready for review
Original prompt

This section details on the original issue you should resolve

<issue_title>Add wp theme cache command</issue_title>
<issue_description>## Feature Request

Describe your use case and the problem you are facing

Add the following commands

wp theme cache <theme> get <key> wp theme cache <theme> add <key> <data>
wp theme cache <theme> delete

Describe the solution you'd like

Add command would map to the method cache_add on WP_Theme class.
Get command would map to the method cache_get on WP_Theme class.
Delete command would map to the method cache_delete on WP_Theme class.

This would help manage and clear theme related caches.

</issue_description>

Comments on the Issue (you are @copilot in this section)

@danielbachhuber I amenable to this. Feel free to submit a pull request, if you'd like. Here is some [guidance on our pull request best practices](https://make.wordpress.org/cli/handbook/contributions/pull-requests/). @swissspidy `WP_Theme::cache_add()` and `WP_Theme::cache_get()` are private, so we can't really use these.

The delete method is public, but maybe this could be used via wp cache delete and wp cache flush-group? The cache key property itself is also private though, so we can't really access it.</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
@github-actionsgithub-actionsBot added command:theme Related to 'theme' command scope:distribution Related to distribution state:unconfirmed labels Feb 2, 2026
CopilotAI changed the title [WIP] Add wp theme cache command functionalityAdd wp theme cache commandFeb 2, 2026
CopilotAI requested a review from swissspidyFebruary 2, 2026 14:05
Comment threadfeatures/theme-cache.feature Outdated
Comment threadfeatures/theme-cache.feature Outdated
Comment threadfeatures/theme-cache.feature Outdated
Comment threadfeatures/theme-cache.feature Outdated
@codecov

This comment was marked as resolved.

@swissspidy
swissspidy marked this pull request as ready for review February 4, 2026 01:56
@swissspidy
swissspidy requested a review from a team as a code ownerFebruary 4, 2026 01:56
CopilotAI review requested due to automatic review settings February 4, 2026 01:56

This comment was marked as resolved.

swissspidyand others added 2 commits February 3, 2026 21:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment threadfeatures/theme-cache.feature Outdated
Comment threadfeatures/theme-cache.feature Outdated
Comment threadsrc/Theme_Cache_Command.php Outdated
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

@swissspidyswissspidy mentioned this pull request Feb 17, 2026
1 task
@swissspidy
swissspidy marked this pull request as draft February 17, 2026 16:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:themeRelated to 'theme' commandscope:distributionRelated to distributionstate:unconfirmed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add wp theme cache command

3 participants

@swissspidy