API / Minn\Front / EmbedCard

EmbedCard final class

Minn\Front\EmbedCard · public/minn/src/Minn/Front/EmbedCard.php · 95 lines

The parts of a post's embed card the reference's embed template prints, as markup: the featured image and its shape (the widest of the image's sizes; wide enough and it sits above the title, else beside it, both by filter), the site's name and icon, the comments and sharing buttons, and the sharing dialog (its ids the post's and a random number, as on the reference). The facade's template tags print them.

Public

staticthumbnail(): ?array#

The featured image the card shows: [attachment id, size, shape], or null. A post's thumbnail, or an image attachment itself, through embed_thumbnail_id, embed_thumbnail_image_size and embed_thumbnail_image_shape.

@return array{0: int, 1: string, 2: string}|null
staticfeaturedImage(?array $thumbnail, string $shape): string#

The featured image's block, when the card shows one of this shape.

staticsiteTitle(): string#

The site's name and icon, linking home, the whole block through embed_site_title_html.

staticcommentsButton(): string#

The comments button: the count, linking to the comments; none on a 404, or with neither comments nor comments open.

staticsharingButton(): string#

The button that opens the sharing dialog; none on a 404.

staticsharingDialog(): string#

The sharing dialog: the post's address and its embed code, each a tab; none on a 404.