Make WordPress Core

Opened 16 years ago

Closed 11 years ago

#13780 closed feature request (duplicate)

WordPress Version Requirement Support for Themes

Reported by: kretzschmar Owned by:
Priority: normal Milestone:
Component: Themes Version:
Severity: normal Keywords: needs-patch
Cc: Focuses:

Description

Right now, there seems to be no way to add a minimum required version to a themes style.css.

This should be used for the automatic update of themes build into WordPress. The theme update should only be applied after WordPress is updated to at least that version.

Attachments (3)

13780-check-theme-version-on-upload.diff (1.9 KB ) - added by pdclark 13 years ago.
Check theme version when uploading .zip. Checks for "Requires at least:" in theme style.css head.
13780-check-theme-version-from-api.diff (861 bytes ) - added by pdclark 13 years ago.
Checks theme version when "requires" value sent by theme API.
13780-check-theme-version-on-activate.diff (1.6 KB ) - added by pdclark 13 years ago.
Check theme version before switching themes. Checks for "Requires at least:" in theme style.css head.

Download all attachments as: .zip

Change History (22)

#1 @dd32
16 years ago

  • Component ThemesWordPress.org
  • Milestone UnassignedWordPress.org site
  • Owner set to ryan
  • Type enhancementfeature request

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.

#2 @ocean90
15 years ago

Related/Duplicate: #16868

#3 @bpetty
14 years ago

  • Cc bpetty added
  • Keywords needs-patch twentythirteen added
  • Milestone WordPress.org3.6
  • Priority normalhigh
  • Summary add require version tag to style.cssTwenty 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.

#4 @lancewillett
14 years ago

  • Cc lancewillett added

#5 @philiparthurmoore
14 years ago

  • Cc philip@… added

#6 @pdclark
13 years ago

  • 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.

#7 @pdclark
13 years ago

  • Keywords needs-patch added; has-patch removed

@pdclark
13 years ago

Check theme version when uploading .zip. Checks for "Requires at least:" in theme style.css head.

@pdclark
13 years ago

Checks theme version when "requires" value sent by theme API.

@pdclark
13 years ago

Check theme version before switching themes. Checks for "Requires at least:" in theme style.css head.

#9 @lancewillett
13 years ago

In 23816:

Twenty Thirteen: add back-compat function to avoid activation with older WordPress installs. Props kovshenin, see #23819 and #13780.

#10 @bpetty
13 years ago

  • Milestone 3.6WordPress.org

As the Twenty Thirteen part of this issue is handled, moving to WordPress.org milestone.

#11 @SergeyBiryukov
13 years ago

  • Summary Twenty Thirteen: WordPress Version Requirement SupportWordPress Version Requirement Support for Themes

#12 @SergeyBiryukov
13 years ago

#16868 was marked as a duplicate.

#13 @cais
13 years ago

  • Cc edward.caissie@… added

#14 @mercime
13 years ago

  • Cc mercijavier@… added

#15 @DrewAPicture
13 years ago

  • Component WordPress.org siteThemes
  • Keywords twentythirteen removed
  • Milestone WordPress.orgAwaiting Review
  • Priority highnormal

#16 @iandunn
13 years ago

The Meta team discussed this and concluded it's more of a Core issue, since the fundamental checks will happen there. If anything is needed from the API or the theme repo, please open ticket(s) on http://meta.trac.wordpress.org.

#17 @iandunn
13 years ago

  • Cc ian.dunn@… added

#18 @ryan
12 years ago

  • Owner ryan removed
  • Status newassigned

#19 @chriscct7
11 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status assignedclosed

Duplicate of #28574.

Note: See TracTickets for help on using tickets.