<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[53416] trunk: Themes: Accept valid block themes.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/53416">53416</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/53416","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>peterwilsoncc</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-05-20 00:47:45 +0000 (Fri, 20 May 2022)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Themes: Accept valid block themes.
Updates theme validation to accept block themes. This replaces the requirement for an `index.php` with a requirement for either an `index.php`, `/templates/index.html` or the deprecated `/block-templates/index.html`.
Validation is updated for theme uploads, within `WP_Theme::__construct` and `validate_current_theme()`.
A block theme using the deprecated file structure is now included in the unit tests.
Props peterwilsoncc, sergeybiryukov, hellofromtonya, costdev, azaozz, gziolo, FlorianBrinkmann, Boniu91, aristath, poena, audrasjb.
Fixes <a href="https://core.trac.wordpress.org/ticket/55754">#55754</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclassthemeupgraderphp">trunk/src/wp-admin/includes/class-theme-upgrader.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemephp">trunk/src/wp-includes/class-wp-theme.php</a></li>
<li><a href="#trunksrcwpincludesthemephp">trunk/src/wp-includes/theme.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiwpRestTemplatesControllerphp">trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php</a></li>
<li><a href="#trunktestsphpunitteststhemethemeDirphp">trunk/tests/phpunit/tests/theme/themeDir.php</a></li>
<li><a href="#trunktestsphpunitteststhemewpThemephp">trunk/tests/phpunit/tests/theme/wpTheme.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/</li>
<li>trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/</li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpathblocktemplatesindexhtml">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/index.html</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpathblocktemplatespagehomehtml">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page-home.html</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpathblocktemplatespagehtml">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page.html</a></li>
<li>trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/parts/</li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpathpartssmallheaderhtml">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/parts/small-header.html</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpathstylecss">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/style.css</a></li>
<li>trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/</li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpathstylesvariationjson">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpaththemejson">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclassthemeupgraderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-theme-upgrader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-theme-upgrader.php 2022-05-20 00:17:16 UTC (rev 53415)
+++ trunk/src/wp-admin/includes/class-theme-upgrader.php 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -566,15 +566,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If it's not a child theme, it must have at least an index.php to be legit.
- if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Parent themes must contain an index file:
+ * - classic themes require /index.php
+ * - block themes require /templates/index.html or block-templates/index.html (deprecated 5.9.0).
+ */
+ if (
+ empty( $info['Template'] ) &&
+ ! file_exists( $working_directory . 'index.php' ) &&
+ ! file_exists( $working_directory . 'templates/index.html' ) &&
+ ! file_exists( $working_directory . 'block-templates/index.html' )
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="cx" style="display: block; padding: 0 10px"> 'incompatible_archive_theme_no_index',
</span><span class="cx" style="display: block; padding: 0 10px"> $this->strings['incompatible_archive'],
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: index.php */
- __( 'The theme is missing the %s file.' ),
- '<code>index.php</code>'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: 1: templates/index.html, 2: index.php, 3: Documentation URL, 4: Template, 5: style.css */
+ __( 'Template is missing. Standalone themes need to have a %1$s or %2$s template file. <a href="%3$s">Child themes</a> need to have a %4$s header in the %5$s stylesheet.' ),
+ '<code>templates/index.html</code>',
+ '<code>index.php</code>',
+ __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ),
+ '<code>Template</code>',
+ '<code>style.css</code>'
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme.php 2022-05-20 00:17:16 UTC (rev 53415)
+++ trunk/src/wp-includes/class-wp-theme.php 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -341,7 +341,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->template = $this->stylesheet;
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_path = $this->theme_root . '/' . $this->stylesheet;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! file_exists( $theme_path . '/templates/index.html' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (
+ ! file_exists( $theme_path . '/templates/index.html' )
+ && ! file_exists( $theme_path . '/block-templates/index.html' ) // Deprecated path support since 5.9.0.
</ins><span class="cx" style="display: block; padding: 0 10px"> && ! file_exists( $theme_path . '/index.php' )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $error_message = sprintf(
</span></span></pre></div>
<a id="trunksrcwpincludesthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme.php 2022-05-20 00:17:16 UTC (rev 53415)
+++ trunk/src/wp-includes/theme.php 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -861,7 +861,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! file_exists( get_template_directory() . '/templates/index.html' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (
+ ! file_exists( get_template_directory() . '/templates/index.html' )
+ && ! file_exists( get_template_directory() . '/block-templates/index.html' ) // Deprecated path support since 5.9.0.
</ins><span class="cx" style="display: block; padding: 0 10px"> && ! file_exists( get_template_directory() . '/index.php' )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid.
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpathblocktemplatesindexhtml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/index.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/index.html (rev 0)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/index.html 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<!-- wp:paragraph -->
+<p>Index Template</p>
+<!-- /wp:paragraph -->
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/index.html
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpathblocktemplatespagehomehtml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page-home.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page-home.html (rev 0)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page-home.html 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<!-- wp:paragraph -->
+<p>Page (Home) Template</p>
+<!-- /wp:paragraph -->
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page-home.html
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpathblocktemplatespagehtml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page.html (rev 0)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page.html 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<!-- wp:paragraph -->
+<p>Page Template</p>
+<!-- /wp:paragraph -->
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/block-templates/page.html
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpathpartssmallheaderhtml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/parts/small-header.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/parts/small-header.html (rev 0)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/parts/small-header.html 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<!-- wp:paragraph -->
+<p>Small Header Template Part</p>
+<!-- /wp:paragraph -->
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/parts/small-header.html
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpathstylecss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/style.css (rev 0)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/style.css 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,7 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/*
+Theme Name: Block Theme Deprecated Path
+Theme URI: https://wordpress.org/
+Description: For testing purposes only.
+Version: 1.0.0
+Text Domain: block-theme-deprecated-path
+*/
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/style.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpathstylesvariationjson"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json (rev 0)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,23 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+{
+ "version": 2,
+ "settings": {
+ "color": {
+ "palette": [
+ {
+ "slug": "foreground",
+ "color": "#3F67C6",
+ "name": "Foreground"
+ }
+ ]
+ }
+ },
+ "styles": {
+ "blocks": {
+ "core/post-title": {
+ "typography": {
+ "fontWeight": "700"
+ }
+ }
+ }
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpaththemejson"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json (rev 0)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,71 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+{
+ "version": 1,
+ "settings": {
+ "color": {
+ "palette": [
+ {
+ "slug": "light",
+ "name": "Light",
+ "color": "#f5f7f9"
+ },
+ {
+ "slug": "dark",
+ "name": "Dark",
+ "color": "#000"
+ }
+ ],
+ "gradients": [
+ {
+ "name": "Custom gradient",
+ "gradient": "linear-gradient(135deg,rgba(0,0,0) 0%,rgb(0,0,0) 100%)",
+ "slug": "custom-gradient"
+ }
+ ],
+ "custom": false,
+ "customGradient": false
+ },
+ "typography": {
+ "fontSizes": [
+ {
+ "name": "Custom",
+ "slug": "custom",
+ "size": "100px"
+ }
+ ],
+ "customFontSize": false,
+ "customLineHeight": true
+ },
+ "spacing": {
+ "units": [
+ "rem"
+ ],
+ "customPadding": true
+ },
+ "blocks": {
+ "core/paragraph": {
+ "color": {
+ "palette": [
+ {
+ "slug": "light",
+ "name": "Light",
+ "color": "#f5f7f9"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "customTemplates": [
+ {
+ "name": "page-home",
+ "title": "Homepage template"
+ }
+ ],
+ "templateParts": [
+ {
+ "name": "small-header",
+ "title": "Small Header",
+ "area": "header"
+ }
+ ]
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsrestapiwpRestTemplatesControllerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php 2022-05-20 00:17:16 UTC (rev 53415)
+++ trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,6 +288,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_excerpt' => 'Description of page home template.',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'template: parent theme deprecated path' => array(
+ 'theme_dir' => 'themedir1/block-theme-deprecated-path',
+ 'template' => 'page-home',
+ 'args' => array(
+ 'post_name' => 'page-home',
+ 'post_title' => 'Home Page Template',
+ 'post_content' => file_get_contents( $theme_root_dir . 'block-theme-deprecated-path/block-templates/page-home.html' ),
+ 'post_excerpt' => 'Description of page home template.',
+ ),
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'template: child theme' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'themedir1/block-theme-child',
</span><span class="cx" style="display: block; padding: 0 10px"> 'template' => 'page-1',
</span></span></pre></div>
<a id="trunktestsphpunitteststhemethemeDirphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/theme/themeDir.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/themeDir.php 2022-05-20 00:17:16 UTC (rev 53415)
+++ trunk/tests/phpunit/tests/theme/themeDir.php 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,14 +165,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'Block Theme Child Theme',
</span><span class="cx" style="display: block; padding: 0 10px"> 'Block Theme [0.4.0]',
</span><span class="cx" style="display: block; padding: 0 10px"> 'Block Theme [1.0.0] in subdirectory',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Block Theme Deprecated Path',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'Webfonts theme',
</span><span class="cx" style="display: block; padding: 0 10px"> 'Empty `fontFace` in theme.json - no webfonts defined',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sort( $theme_names );
- sort( $expected );
-
- $this->assertSame( $expected, $theme_names );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameSets( $expected, $theme_names );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststhemewpThemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/theme/wpTheme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/wpTheme.php 2022-05-20 00:17:16 UTC (rev 53415)
+++ trunk/tests/phpunit/tests/theme/wpTheme.php 2022-05-20 00:47:45 UTC (rev 53416)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,6 +309,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'block-theme-child',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'deprecated block theme' => array(
+ 'theme_dir' => 'block-theme-deprecated-path',
+ 'expected' => true,
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -335,42 +339,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_get_file_path() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'no theme: no file given' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'no theme: no file given' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'nonexistent',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/nonexistent',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'parent theme: no file given' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'parent theme: no file given' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'block-theme',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/block-theme',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'child theme: no file given' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'child theme: no file given' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'block-theme-child',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/block-theme-child',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'nonexistent theme: file given' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'nonexistent theme: file given' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'nonexistent',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '/templates/page.html',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/nonexistent/templates/page.html',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'parent theme: file exists' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'parent theme: file exists' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'block-theme',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '/templates/page-home.html',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/block-theme/templates/page-home.html',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'parent theme: file does not exist' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'parent theme: deprecated file exists' => array(
+ 'theme_dir' => 'block-theme-deprecated-path',
+ 'file' => '/block-templates/page-home.html',
+ 'expected' => '/block-theme-deprecated-path/block-templates/page-home.html',
+ ),
+ 'parent theme: file does not exist' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'block-theme',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '/templates/nonexistent.html',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/block-theme/templates/nonexistent.html',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'child theme: file exists' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'child theme: file exists' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'block-theme-child',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '/templates/page-1.html',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/block-theme-child/templates/page-1.html',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'child theme: file does not exist' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'child theme: file does not exist' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'theme_dir' => 'block-theme-child',
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => '/templates/nonexistent.html',
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => '/block-theme/templates/nonexistent.html',
</span></span></pre>
</div>
</div>
</body>
</html>