Skip to content

Fix the PHPStan level 10 errors that core reports - #171

Merged
MaggieCabrera merged 25 commits into
trunkfrom
fix/phpstan-level-10
Nov 9, 2026
Merged

MaggieCabrera merged 25 commits into
trunkfrom
fix/phpstan-level-10

Conversation

@westonruter

@westonruter westonruter commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Description

This was first opened against WordPress core as WordPress/wordpress-develop#14701, which was closed in favor of this PR, so that the changes are made here and reach core with the next sync. The commits are the same, ported to this repository.

Since Ipsum was imported into core, core's PHPStan analysis covers it. At level 10, it reported 69 errors in Ipsum, all of which are fixed here. After trunk was merged in, the design guide ability added in #182 (inc/abilities.php) brought 64 more. Those are fixed too, except for one low-severity error type, described below.

  • Pattern image URLs. The ?ver= query string added to the pattern images in Rename the theme functions and add the theme version to pattern images #163 is removed, as Twenty Twenty-Four and Twenty Twenty-Five don't version their pattern images either. The images are placeholders that won't change after release, and once a pattern is inserted, its image URL is saved in the post, so the version would never update there anyway. This accounted for 60 of the errors, since WP_Theme::get( 'Version' ) returns string|false, which esc_attr() does not accept. (An ipsum_get_asset_url() helper was first added to keep the version, but it was removed after review.) The URLs are now built with get_parent_theme_file_uri( 'assets/images/…' ) rather than by appending the path to get_template_directory_uri(), matching how ipsum_enqueue_styles() gets style.css. The URL is the same, but it can be filtered with parent_theme_file_uri. The pattern image guidance and example in CONTRIBUTING.md are updated to match.
  • Stylesheet version. ipsum_enqueue_styles() loads the parent theme's style.css but versioned it with the active theme. With a child theme active, updating Ipsum did not change the stylesheet URL. It now uses wp_get_theme( get_template() ).
  • Comments call to action binding. The postId context is untyped, and its get_the_ID() fallback can be false. The post is now resolved with get_post(), which falls back to the current post as before, and the callback returns null when there is none, so the block keeps its original content. The check from Hide the comments CTA and its separators when comments are closed #184 that hides the call to action when comments are closed now runs against that post. The unused $source_args, which has to be accepted to reach the block instance, is unset and documented as unused.
  • Search block ARIA label support. The block supports are narrowed to an array before ariaLabel is added.
  • Design guide ability. The presets, the color role slugs, the pattern slug from template markup, the pattern file paths, and the block styles of the global styles and of each style variation are checked to be arrays or strings before they are iterated, used as keys, or passed to functions that require them. The schema has an array shape, so its section names can be read from its properties.
  • Value types in the docblocks of the block binding args, the template types, the block metadata, and the design guide.

Native types were left off the hook callbacks' parameters, since a plugin filtering in a non-array would otherwise cause a fatal error.

Not addressed: 41 reports of offsetAccess.nonOffsetAccessible remain in inc/abilities.php. They come from nested reads such as $settings['custom']['controlScheme'] ?? '' into the mixed that wp_get_global_settings() and wp_get_global_styles() return, and into the style variations. At runtime, ?? already falls back to the default whatever type each level turns out to be, so these are low severity. Silencing them would take a helper to walk each path, which adds code for no change in behavior. Core's _wp_array_get() does exactly that, but it is private, it is used by only four themes in the directory (about 180 active installs in all) and by none of the bundled ones, and its first parameter is typed array, so each mixed value would still need an is_array() check before it is passed in. Level 10 is stricter than anything else in core, so they are left as an exception.

Screenshots

No visual change is intended.

Testing Instructions

  1. Run npm run lint. It passes.
  2. Insert the Gallery Offset and CTA Membership patterns in a post. The images load, and their URLs have no ?ver= query string.
  3. With a child theme of Ipsum active, the ipsum-style stylesheet URL ends in ?ver=1.0, Ipsum's version, not the child theme's.
  4. View a single post using a template with the comments call to action. The link reads "Be the first to comment" or "Join the conversation", depending on the comment count, and is hidden on a post with comments closed.
  5. In the Site Editor, a Search block offers an ARIA label setting.
  6. As an administrator, run the ipsum/get-design-guide ability. It returns every section, including the colors with their roles, the style variations, and the templates with their patterns.
  7. Check the front end and the Site Editor with the default colors and at least one other color variation.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5 (medium effort)
Used for: Running PHPStan at level 10 in core, implementing the fixes under direction, checking the changed callbacks with WP-CLI, porting the commits from core to this repository, and resolving the merge conflicts with trunk.

@github-actions github-actions Bot added [Area] Patterns Issues or PRs that touch the theme's block patterns. [Area] Theme Functions Issues or PRs that touch functions.php. labels Oct 22, 2026
@westonruter
westonruter marked this pull request as ready for review October 22, 2026 20:31
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: mikachan <mikachan@git.wordpress.org>
Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Comment thread functions.php Outdated
*/
function ipsum_get_asset_url( string $path ): string {
$url = get_parent_theme_file_uri( $path );
$version = wp_get_theme( get_template() )->get( 'Version' );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important because get_parent_theme_file_uri( 'style.css' ) only ever refers to the parent theme's style.css, but without passing get_template() here, then it defaults to the child theme.

westonruter and others added 11 commits October 28, 2026 11:17
Thirteen Ipsum patterns append the theme version to image URLs as a
cache busting query string, read with `WP_Theme::get( 'Version' )`. That
returns `string|false`, which `esc_attr()` does not accept, so each of the
60 call sites was a PHPStan level 7 error.

`ipsum_get_version()` narrows the header to a string, falling back to an
empty string when it cannot be read, and the patterns now call it. As
before, the version comes from the parent theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`ipsum_enqueue_styles()` loads the parent theme's `style.css` but versioned
it with `wp_get_theme()`, which is the active theme. With a child theme
active, that is the child's version, so updating Ipsum left the stylesheet
URL unchanged, and sites with long static file caches could keep serving
the old file.

Pass `get_template()` so the version is Ipsum's, as the pattern images
already do and as Twenty Twenty-Four does for its parent theme styles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace `ipsum_get_version()` with `ipsum_get_asset_url()`, which takes a
path relative to the theme directory, resolves it with
`get_parent_theme_file_uri()`, and adds the parent theme version as the
`ver` query argument with `add_query_arg()`, skipping it when the version
cannot be read.

The patterns now pass the image path to the helper instead of joining the
template directory URI, the path, and a hand-built query string, which
also stops them emitting an empty `?ver=` when there is no version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`get_parent_theme_file_uri()` returns the theme directory URL rather than
a file URL when the path is empty, which includes `'0'`, so neither is a
valid asset path for `ipsum_get_asset_url()`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The block binding source arguments are an object decoded from the block's
`metadata.bindings` attribute, so they are keyed by string with values of
any type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `postId` block context is untyped, and its fallback, `get_the_ID()`,
returns `false` when there is no current post, so neither was a valid
argument for `get_comments_number()` or `get_comments_link()`.

Resolve the post with `get_post()` instead, which falls back to the
current post just as `get_the_ID()` did, and return null when there is
none, so the block keeps its original content rather than linking to
comments on no post.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `default_template_types` filter passes template types keyed by slug,
each an array with a string title and description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `block_type_metadata` filter passes the decoded `block.json`, keyed by
string with values of any type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The block metadata values are untyped, so writing `ariaLabel` straight
into `$metadata['supports']` wrote an offset on a mixed value. Read the
supports into a local array first, starting from an empty one when it is
missing or not an array, then add the ARIA label support and assign it
back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Block bindings pass the source arguments before the block instance, so
`ipsum_comments_cta_binding()` must accept them to reach the block, even
though it does not use them. Unset them to mark them as deliberately
unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaggieCabrera

Copy link
Copy Markdown
Contributor

Thanks, Weston. I’d rather not add a helper to the patterns, since no other default theme does that. Looking at it again, I don’t think we need ?ver= on the pattern images at all:

The images are placeholders, so they won’t change after release. If one ever does, it can ship under a new file name.
When someone inserts a pattern, the image URL is saved into their post, so the version never updates there anyway.
Twenty Twenty-Four and Twenty Twenty-Five don’t version their pattern images either.

I’ll drop ?ver= from the patterns, which also clears those 60 errors without the helper. Could you take ipsum_get_asset_url() out of this PR and keep the rest? The stylesheet version fix is a good catch.

@peterwilsoncc, this undoes the cache busting you suggested in the core review, for the reasons above.

westonruter and others added 2 commits October 28, 2026 08:04
The pattern images are placeholders that won't change after release, and
once a pattern is inserted, its image URL is saved in the post, so a `ver`
query argument would never update there anyway. Twenty Twenty-Four and
Twenty Twenty-Five don't version their pattern images either, and no
other default theme uses a helper in its patterns.

So remove `ipsum_get_asset_url()` and build the image URLs from
`get_template_directory_uri()` as before, without `?ver=`. This also
avoids passing the `string|false` theme version to `esc_attr()`, which
was what the helper was added to fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rather than appending the image path to `get_template_directory_uri()`,
pass it to `get_parent_theme_file_uri()`, which `ipsum_enqueue_styles()`
already uses for `style.css`. The URL is the same, but it can now be
filtered with `parent_theme_file_uri`, such as to serve the images from a
CDN, and each URL is built by a single call instead of being concatenated
in the markup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@westonruter

Copy link
Copy Markdown
Member Author

@MaggieCabrera Thanks. I dropped the helper in 9f94692. However, it seems like it would still be marginally better to not use get_template_directory_uri() directly. It seems cleaner to instead use get_parent_theme_file_uri() and pass the image path to that function. It ultimately calls get_template_directory_uri() anyway, but with the added benefit of the parent_theme_file_uri filter applying on the full URL. So I made that additional suggestion in fc2c15b, but it can be reverted if you don't want it.

@mikachan mikachan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @westonruter, I think get_parent_theme_file_uri() makes sense to keep. It's a Core function rather than a theme helper, so it doesn't add anything new to the patterns, and it matches what #150 is doing for ipsum_enqueue_styles(). @MaggieCabrera, does that sound OK to you?

If we keep it, I think the example in CONTRIBUTING.md should use get_parent_theme_file_uri() too, so new patterns follow the same approach.

westonruter and others added 3 commits November 8, 2026 09:01
Resolve conflicts in functions.php and four patterns:

* Keep the branch's post lookup in ipsum_comments_cta_binding() and add
  trunk's comments_open() check against that post, returning an empty
  string when comments are closed. Document the new return value.
* Take trunk's renamed palette slugs in cta-membership, format-audio,
  kind-words, and page-soon, and rewrite their image URLs with
  get_parent_theme_file_uri() as the branch does elsewhere.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
The ability reads the section names from the keys of its properties, so
describe the schema as an object whose properties are keyed by section.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
The global settings come back as mixed, and a site can save any shape
of preset in Global Styles, so skip origins and presets that are not
arrays instead of iterating or indexing them blindly.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
westonruter and others added 9 commits November 8, 2026 09:05
The global settings and styles come back as mixed, and the style
variations as untyped arrays, so indexing several levels into them is
unchecked. Walk each path with a helper that returns null as soon as a
level is not an array or lacks the key, and keep only the array entries
of a variation's block styles.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
A palette saved in Global Styles can hold any value as a slug, so check
that it is a string before using it as a key into the roles.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
Block attributes parsed from template markup are unvalidated, so a
Pattern block's slug is only returned when it is a non-empty string.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
A pattern registered with register_block_pattern() can carry any value
as its filePath, so only take its directory when it is a non-empty
string.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
The guide is keyed by section name, with each section holding its own
shape of data.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
The patterns now pass each image path to `get_parent_theme_file_uri()`
and no longer append a `?ver=` argument, so update the contributing
guide's pattern image guidance and example to match, and say why the
version is left off.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
…de."

This reverts commit 9a5e9c8, keeping the string slug check for the color
roles from 6155935.

The helper only silenced PHPStan's level 10 reports of offset access on
mixed: at runtime, `??` already falls back to the default whatever type
each level of the theme.json data turns out to be. Level 10 is stricter
than anything else in core, so those reports are left as they are, and
the nested reads go back to plain `??`.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
`??` covers a missing `blocks` key in the global styles, but not one
holding another type, which `foreach` would warn on.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
A variation's `blocks` styles, and each block's styles within them,
come from an untyped theme.json file, so `array_map( 'array_keys', … )`
would throw a TypeError on one that is not an array. Check both levels
before taking the keys.

Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com>
Claude-Code-Session-Id: 6d5fb8f3-c7e8-4bce-8351-2e2825d9f5b7
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 8, 2026
@westonruter

Copy link
Copy Markdown
Member Author

If we keep it, I think the example in CONTRIBUTING.md should use get_parent_theme_file_uri() too, so new patterns follow the same approach.

@mikachan Updated in f09fb9e

@mikachan mikachan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM, pending @MaggieCabrera's thoughts.

@MaggieCabrera MaggieCabrera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bring this in. Thank you all for your patience and your work on this, it's appreciated

@MaggieCabrera
MaggieCabrera merged commit af3c124 into trunk Nov 9, 2026
7 checks passed
@MaggieCabrera
MaggieCabrera deleted the fix/phpstan-level-10 branch November 9, 2026 12:28
MaggieCabrera added a commit to MaggieCabrera/wordpress-develop that referenced this pull request Nov 9, 2026
Core's PHPStan analysis has covered Ipsum since the import, and at level 10 it reported errors in the patterns and the design guide ability. Pattern images no longer get a `?ver=` query string, like the pattern images in Twenty Twenty-Four and Twenty Twenty-Five, and their URLs now come from `get_parent_theme_file_uri()`.

Synced from WordPress/ipsum#171.

See #66631.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wporg-sync pushed a commit to WordPress/wordpress-develop that referenced this pull request Nov 10, 2026
This updates Ipsum from `17a7ada71378a21c36670d67725b3ca632845a9f` to `bc2e5af700e28980f251d97f58cf80c72ee50a13` on its `trunk` branch.

A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@17a7ada...bc2e5af

- theme.json: Give negative outline offset for Button's focus styles (WordPress/ipsum#187)
- Fix view transitions ignoring prefers-reduced-motion (WordPress/ipsum#198)
- Register the pattern utility classes as block styles (WordPress/ipsum#180)
- Fix the PHPStan level 10 errors that core reports (WordPress/ipsum#171)
- Provide style.min.css for production (WordPress/ipsum#61)
- Use the border radius shorthand in the patterns (WordPress/ipsum#206)
- Describe every pattern and offer the format patterns as starter patterns (WordPress/ipsum#181)
- Move what theme.json can express out of the block css strings (WordPress/ipsum#185)
- Clean up editor-only attributes and serialization in the patterns (WordPress/ipsum#204)
- Add DESIGN.md with the theme's design model (WordPress/ipsum#186)
- Inline the theme stylesheet (WordPress/ipsum#63)
- Design guide: Return all theme patterns after the registry has read them (WordPress/ipsum#192)

This commit also includes changes that only exist in core:

- Ipsum is added to the `cssmin:themes` Grunt task, so the build makes the `style.min.css` that the theme now enqueues. The built file is ignored.
- The theme's `node_modules` directory is ignored, and left out of core's build.
- The theme gets its own stylesheet build process, with `build` and `watch` commands that minify `style.css` into `style.min.css`, set up through a new `package.json`, `package-lock.json` and `.nvmrc`. 
- A new `contributing.txt` documents the build process and the `test-and-zip-default-themes` workflow now tests and runs that build for Ipsum.
- Regression tests for the design guide ability are added in core, with a child theme fixture, because Ipsum's repository has no PHPUnit setup.

Follow-up to r60934, r64677, r64678, r64679, r65224.

Props yashjawale, shailu25, onemaggie, westonruter, josephscott, juanfra, mehtadev, mikachan, ravipatel, wildworks, courane01, poena, gziolo.
Fixes #66631.
See #66352.




git-svn-id: https://develop.svn.wordpress.org/trunk@65366 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 10, 2026
This updates Ipsum from `17a7ada71378a21c36670d67725b3ca632845a9f` to `bc2e5af700e28980f251d97f58cf80c72ee50a13` on its `trunk` branch.

A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@17a7ada...bc2e5af

- theme.json: Give negative outline offset for Button's focus styles (WordPress/ipsum#187)
- Fix view transitions ignoring prefers-reduced-motion (WordPress/ipsum#198)
- Register the pattern utility classes as block styles (WordPress/ipsum#180)
- Fix the PHPStan level 10 errors that core reports (WordPress/ipsum#171)
- Provide style.min.css for production (WordPress/ipsum#61)
- Use the border radius shorthand in the patterns (WordPress/ipsum#206)
- Describe every pattern and offer the format patterns as starter patterns (WordPress/ipsum#181)
- Move what theme.json can express out of the block css strings (WordPress/ipsum#185)
- Clean up editor-only attributes and serialization in the patterns (WordPress/ipsum#204)
- Add DESIGN.md with the theme's design model (WordPress/ipsum#186)
- Inline the theme stylesheet (WordPress/ipsum#63)
- Design guide: Return all theme patterns after the registry has read them (WordPress/ipsum#192)

This commit also includes changes that only exist in core:

- Ipsum is added to the `cssmin:themes` Grunt task, so the build makes the `style.min.css` that the theme now enqueues. The built file is ignored.
- The theme's `node_modules` directory is ignored, and left out of core's build.
- The theme gets its own stylesheet build process, with `build` and `watch` commands that minify `style.css` into `style.min.css`, set up through a new `package.json`, `package-lock.json` and `.nvmrc`. 
- A new `contributing.txt` documents the build process and the `test-and-zip-default-themes` workflow now tests and runs that build for Ipsum.
- Regression tests for the design guide ability are added in core, with a child theme fixture, because Ipsum's repository has no PHPUnit setup.

Follow-up to r60934, r64677, r64678, r64679, r65224.

Props yashjawale, shailu25, onemaggie, westonruter, josephscott, juanfra, mehtadev, mikachan, ravipatel, wildworks, courane01, poena, gziolo.
Fixes #66631.
See #66352.



Built from https://develop.svn.wordpress.org/trunk@65366


git-svn-id: http://core.svn.wordpress.org/trunk@64505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
arshidkv12 pushed a commit to arshidkv12/wordpress-develop that referenced this pull request Nov 21, 2026
This updates Ipsum from `17a7ada71378a21c36670d67725b3ca632845a9f` to `bc2e5af700e28980f251d97f58cf80c72ee50a13` on its `trunk` branch.

A full list of changes included in this commit can be found on GitHub: WordPress/ipsum@17a7ada...bc2e5af

- theme.json: Give negative outline offset for Button's focus styles (WordPress/ipsum#187)
- Fix view transitions ignoring prefers-reduced-motion (WordPress/ipsum#198)
- Register the pattern utility classes as block styles (WordPress/ipsum#180)
- Fix the PHPStan level 10 errors that core reports (WordPress/ipsum#171)
- Provide style.min.css for production (WordPress/ipsum#61)
- Use the border radius shorthand in the patterns (WordPress/ipsum#206)
- Describe every pattern and offer the format patterns as starter patterns (WordPress/ipsum#181)
- Move what theme.json can express out of the block css strings (WordPress/ipsum#185)
- Clean up editor-only attributes and serialization in the patterns (WordPress/ipsum#204)
- Add DESIGN.md with the theme's design model (WordPress/ipsum#186)
- Inline the theme stylesheet (WordPress/ipsum#63)
- Design guide: Return all theme patterns after the registry has read them (WordPress/ipsum#192)

This commit also includes changes that only exist in core:

- Ipsum is added to the `cssmin:themes` Grunt task, so the build makes the `style.min.css` that the theme now enqueues. The built file is ignored.
- The theme's `node_modules` directory is ignored, and left out of core's build.
- The theme gets its own stylesheet build process, with `build` and `watch` commands that minify `style.css` into `style.min.css`, set up through a new `package.json`, `package-lock.json` and `.nvmrc`. 
- A new `contributing.txt` documents the build process and the `test-and-zip-default-themes` workflow now tests and runs that build for Ipsum.
- Regression tests for the design guide ability are added in core, with a child theme fixture, because Ipsum's repository has no PHPUnit setup.

Follow-up to r60934, r64677, r64678, r64679, r65224.

Props yashjawale, shailu25, onemaggie, westonruter, josephscott, juanfra, mehtadev, mikachan, ravipatel, wildworks, courane01, poena, gziolo.
Fixes #66631.
See #66352.




git-svn-id: https://develop.svn.wordpress.org/trunk@65366 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Patterns Issues or PRs that touch the theme's block patterns. [Area] Theme Functions Issues or PRs that touch functions.php. documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants