ThemeStyles final readonly class
Minn\Theme\ThemeStyles · public/minn/src/Minn/Theme/ThemeStyles.php · 142 lines
The active theme's global styles as wp/v2/global-styles/themes/{stylesheet} reports them: the engine's defaults (captured from the reference under a theme with no theme.json) with the theme's own settings and styles over them, and the style variations the theme ships.
Constants and properties
| private | readonly ?Minn\Theme\Theme $theme | Promoted from the constructor. |
| prop | readonly string $stylesheet | Promoted from the constructor. |
| private | readonly ?array $core | Promoted from the constructor. |
Public
| new | __construct(?Minn\Theme\Theme $theme, string $stylesheet, ?array $core = NULL)# |
| ||||||
| method | withFilteredCore(): self# | The same styling data over core's layer as wp_theme_json_data_default leaves it, for the places the reference reads core's layer through that filter (its resolver's core and merged data). | ||||||
| static | forSite(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, string $themesDir): self# | The site's active theme as styling data, whether or not it is a block theme. | ||||||
| method | settings(): array# | Settings: presets by origin, appearanceTools expanded, the defaults underneath. | ||||||
| method | patterns(): array# | The pattern directory slugs the theme.json lists (its patterns), as given; [] when it lists none. @return array<mixed> @return array<mixed> | ||||||
| method | styles(): array# | Styles: the theme's over the defaults, block style partials and section styles in, every var:preset token resolved. | ||||||
| method | variations(): array# | The style variations under styles/: every JSON file there that names no blockTypes (those are block style partials), the parent theme's first, in path order, $schema dropped and the nodes normalized the way the theme's own are. @return list<array> |
Internals 4
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | withSectionStyles(array $styles, array $partials): array# | A root styles.variations node names section styles by the slug of the block style partial that declares them; each lands under every block type that partial names, the blocks it has to add in name order, and the root node goes.
| |||
| private | partials(): array# | The block style partials under styles/: slug => the block types each names. @return array<string, list<string>> | |||
| private | defaults(): array# | @return array{settings?: array, styles?: array} core's layer: the one given, else the stored one | |||
| private | storedCore(): array# | @return array{settings: array, styles: array} core's own layer as stored |
Nothing matches.