Make WordPress Core

Opened 11 months ago

Last modified 8 days ago

#44592 new enhancement

Add support for required WP and PHP versions to themes

Reported by: flixos90 Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch servehappy
Focuses: Cc:


As a follow-up to #40934 and accompanying the related meta ticket https://meta.trac.wordpress.org/ticket/3718, themes should be allowed to specify minimum required WordPress / PHP versions.

The scope of this ticket is solely to add support for these two headers to WP_Theme, so that they are parsed correctly. Catching unmet version requirements and preventing theme installations/updates/activations should be part of separate follow-up tickets.

This ticket needs to be tackled in alignment with the above meta ticket, in terms of which names to use for the two new headers.

Attachments (1)

44592.diff (656 bytes) - added by flixos90 11 months ago.

Download all attachments as: .zip

Change History (8)

11 months ago

#1 @flixos90
11 months ago

  • Keywords has-patch added; needs-patch removed

44592.diff adds support for a Requires header (for required WP version) and a Requires PHP header (for required PHP version) to WP_Theme. While we could go with Requires WP, I thought it would make sense to align the names with the names of the plugin headers, so people can remember them easily for both plugins and themes.

Going forward though, let's have the discussion on header names in the meta ticket https://meta.trac.wordpress.org/ticket/3718, and adjust the patch here accordingly as necessary.

This ticket was mentioned in Slack in #core-php by flixos90. View the logs.

11 months ago

This ticket was mentioned in Slack in #core-php by schlessera. View the logs.

11 months ago

#4 @pento
8 months ago

  • Milestone changed from 4.9.9 to WordPress.org

#5 @afragen
5 weeks ago

  • Keywords servehappy added

#7 @afragen
8 days ago

I think we should use Requires WP as it is more descriptive and aligns well with Requires PHP.

Note: See TracTickets for help on using tickets.