API / Minn\Theme / BodyClasses

BodyClasses final class

Minn\Theme\BodyClasses · public/minn/src/Minn/Theme/BodyClasses.php · 86 lines

The body-class list a classic theme's body_class() starts from, in the reference's order: the query tokens (with the singular and template tokens spliced in front of the type token), logged-in, the embed and theme tokens, with the numbered paging tokens re-seated after the embed token. The body_class filter runs over this list in the facade.

Public

staticclassic(Minn\Front\Resolution $resolution, array $coreClasses, ?string $customTemplate, string $themeSlug, ?string $parentSlug, Minn\Theme\BodyFacts $facts): array#

The body classes a classic theme's page carries.

$coreClasseslist<string>
@return list<string>
staticforView(?string $singular, array $coreClasses, ?string $customTemplate, string $themeSlug, ?string $parentSlug, Minn\Theme\BodyFacts $facts): array#

The same list for a view named by the post type it shows alone (null when it shows no single post), as get_body_class needs off the front (probe post-template-remaining).

$coreClasseslist<string>
@return list<string>

Internals 1

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

privatewithSingularTokens(?string $singular, array $classes, ?string $customTemplate): array#
$classeslist<string>
@return list<string>