API / Minn\Rest / GlobalStylesObject

GlobalStylesObject final readonly class

Minn\Rest\GlobalStylesObject · public/minn/src/Minn/Rest/GlobalStylesObject.php · 87 lines

The wp/v2/global-styles item, theme, and revision shapes.

Constants and properties

privatereadonly Minn\Content\Revisions $revisions

Promoted from the constructor.

privatereadonly Minn\Rest\RestUrl $url

Promoted from the constructor.

privatereadonly Minn\Rest\Caller $caller

Promoted from the constructor.

Public

new__construct(Minn\Content\Revisions $revisions, Minn\Rest\RestUrl $url, Minn\Rest\Caller $caller)#
methoditem(Minn\Content\PostRecord $post, Minn\Rest\Context $context): array#

The saved styles: the title both ways, settings by origin, styles with their presets resolved, the links; in editing context the app's lock fields too, which a global-styles post never carries.

methodtheme(array $settings, array $styles, string $stylesheet): array#

The active theme's own styles as the themes/{stylesheet} route answers them.

methodrevision(Minn\Content\PostRecord $revision): array#

One revision row: both nodes when the body holds anything at all, neither when it is blank, then the row's own facts; no links.

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatelinks(Minn\Content\PostRecord $post): array#

Writing methods appear for a theme editor; the CSS action for whoever may write CSS.

privatenode(array $node): stdClass|array#

An empty node is an object on the wire, never a list.