diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index a72035331f..dba5cb3d6b 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -21,6 +21,8 @@ final class WP_Theme implements ArrayAccess { /** * Headers for style.css files. * + * @since 3.4.0 + * @since 5.4.0 Added `Requires at least` and `Requires PHP` headers. * @var array */ private static $file_headers = array( @@ -35,6 +37,8 @@ final class WP_Theme implements ArrayAccess { 'Tags' => 'Tags', 'TextDomain' => 'Text Domain', 'DomainPath' => 'Domain Path', + 'RequiresWP' => 'Requires at least', + 'RequiresPHP' => 'Requires PHP', ); /** @@ -801,11 +805,13 @@ final class WP_Theme implements ArrayAccess { * Sanitize a theme header. * * @since 3.4.0 + * @since 5.4.0 Added support for `Requires at least` and `Requires PHP` headers. * * @staticvar array $header_tags * @staticvar array $header_tags_with_a * - * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags. + * @param string $header Theme header. Accepts 'Name', 'Description', 'Author', 'Version', + * 'ThemeURI', 'AuthorURI', 'Status', 'Tags', 'RequiresWP', 'RequiresPHP'. * @param string $value Value to sanitize. * @return string|array An array for Tags header, string otherwise. */ @@ -853,6 +859,8 @@ final class WP_Theme implements ArrayAccess { $value = array_filter( array_map( 'trim', explode( ',', strip_tags( $value ) ) ) ); break; case 'Version': + case 'RequiresWP': + case 'RequiresPHP': $value = strip_tags( $value ); break; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2505788971..ff8e6678f2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-47144'; +$wp_version = '5.4-alpha-47145'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.