Opened 3 years ago
Last modified 2 months ago
#13780 new feature request
Twenty Thirteen: WordPress Version Requirement Support
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 3.6 |
| Component: | WordPress.org site | Version: | |
| Severity: | normal | Keywords: | twentythirteen needs-patch |
| Cc: | bpetty, lancewillett, philip@… |
Attachments (3)
Change History (12)
- Component changed from Themes to WordPress.org
- Milestone changed from Unassigned to WordPress.org site
- Owner set to ryan
- Type changed from enhancement to feature request
- Cc bpetty added
- Keywords needs-patch twentythirteen added
- Milestone changed from WordPress.org to 3.6
- Priority changed from normal to high
- Summary changed from add require version tag to style.css to Twenty Thirteen: WordPress Version Requirement Support
Pushing this to 3.6 milestone since this is now a priority for Twenty Thirteen.
As discussed in Twenty Thirteen office hours, this theme will require WP 3.6 (mostly due to post formats focus).
The tasks involved here may include:
- Hiding WP.org themes with specified requirement in style.css from themes API search used by older versions of WP (API and core work required).
- Preventing activation of theme uploaded manually by ZIP if minimum required WP version is not met (which obviously won't help older versions of WP, but will help in the future with this).
See this post for more info.
comment:4
lancewillett — 3 months ago
- Cc lancewillett added
- Cc philip@… added
- Keywords has-patch added; needs-patch removed
Uploaded patches for all the cases I could think of.
13780-check-theme-version-on-upload.diff checks theme's minimum required WordPress version not just on upload, but also when a theme is being installed from themes_api(). Because of this, 13780-check-theme-version-from-api.diff isn't really necessary unless modifying the remote API is worth saving a small bit of bandwidth.
13780-check-theme-version-on-activate.diff covers cases where a user might have uploaded a theme over FTP – it does a check during switch_theme(), which should catch when clicking "Activate" or doing a theme preview.
Some things to consider:
- I used "Requires at least" as the plugin head key to match wordpress.org plugin syntax for readme.txt. If matching theme head / plugin head to readme.txt isn't necessary, then "Requires" is worth considering.
- The WP_Error IDs being passed currently match their context -- incompatible_archive and themes_api_failed. A more specific error, like requirement_not_met might be appropriate
- API revision isn't necessary when Theme_Upgrader is patched.
Items I didn't address:
- Hiding incompatible themes outright in API search. It seems like a flag or warning might be more appropriate.
comment:8
SergeyBiryukov — 2 months ago
Related: #23819
Check theme version when uploading .zip. Checks for "Requires at least:" in theme style.css head.
Check theme version before switching themes. Checks for "Requires at least:" in theme style.css head.
comment:9
lancewillett — 2 months ago
In 23816:

This doesnt really need to be done inside of WordPress, rather, its a feature request for the Themes directory.
With all the new functionalities in each version, and the functions which Themes can call to register certain things, Adding a required version would get a +1 for me.