API / Minn\Blocks\Dynamic

Minn\Blocks\Dynamic

Dynamic core blocks that render from data. 9 classes, 11 public methods and 7 internals. This page is the public surface; each class name opens the whole class.

Archives final readonly class

public/minn/src/Minn/Blocks/Dynamic/Archives.php · 29 lines · Open the class →

core/archives: the months that have published posts, newest first, with their counts when asked (showPostCounts).

Calendar final class

public/minn/src/Minn/Blocks/Dynamic/Calendar.php · 36 lines · Open the class →

The calendar block's colours: the reference puts them on the calendar's table, not on the block's wrapper. A colour preset is a pair of classes; a custom colour, only where no preset is named, is its marker class and a declaration in the table's style attribute (probe blocks-rest-widget-doubts). Gradients are not carried.

staticwithoutColours(Minn\Blocks\Block $block): Minn\Blocks\Block

The block with its colours taken off, for the wrapper.

staticcolourTable(Minn\Blocks\Block $block, string $calendar): string

The calendar's markup with the block's colours on its table.

Dates final class

public/minn/src/Minn/Blocks/Dynamic/Dates.php · 15 lines · Open the class →

Site-local dates the way the dynamic blocks print them.

staticiso(Minn\Content\Site $site, string $local): string

ISO 8601 with the site's offset at that date (summer or winter time), from a site-local MySQL datetime.

staticformat(Minn\Content\Site $site, string $local, string $format = ''): string

A site-local MySQL datetime in the format given, else the date_format option, in the site's language.

LatestComments final readonly class

public/minn/src/Minn/Blocks/Dynamic/LatestComments.php · 71 lines · Open the class →

core/latest-comments: the newest approved comments with avatar, meta, and a 20-word excerpt.

LatestPosts final readonly class

public/minn/src/Minn/Blocks/Dynamic/LatestPosts.php · 148 lines · Open the class →

core/latest-posts: the newest published posts as a list or a grid, each with its featured image, title, author, date and excerpt or whole content as the block asks (probe latest-posts).

new__construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Content\Users $users)
methodrender(Minn\Blocks\Block $block): string

The block's HTML. The posts come from WP_Query with the reference's arguments (so pre_get_posts and the posts_* filters shape them), walked as the reference walks them: the_post for each (loop_start and loop_end around them, loop_no_results when there are none), and the main query's post set up again after, found or not.

insidefeaturedImage(), words(), args()

SyncedPattern final readonly class

public/minn/src/Minn/Blocks/Dynamic/SyncedPattern.php · 33 lines · Open the class →

core/block: a synced pattern, rendered from the wp_block post it references.

TagCloud final readonly class

public/minn/src/Minn/Blocks/Dynamic/TagCloud.php · 36 lines · Open the class →

core/tag-cloud: non-empty tags by name, sized from 8pt to 22pt in proportion to their counts (every tag at 8pt when the counts are equal).