API / Minn\Widgets

Minn\Widgets

2 classes, 17 public methods and 7 internals. This page is the public surface; each class name opens the whole class.

WidgetForms final class

public/minn/src/Minn/Widgets/WidgetForms.php · 203 lines · Open the class →

The core widgets' settings forms, the markup a widget's form() prints and wp/v2/widgets returns as rendered_form, character for character as the reference prints it (probe rest-widgets): field ids and names from the widget's number, values escaped, defaults filled in. The whitespace is the reference's own and is part of the answer.

statictitle(WP_Widget $widget, array $instance): string

The title field most widgets open with.

statictitleOnly(WP_Widget $widget, array $instance): string

search, meta, calendar: the title alone.

staticpages(WP_Widget $widget, array $instance): string

The pages widget: title, sort order, pages to leave out.

staticarchives(WP_Widget $widget, array $instance): string

The archives widget: title, dropdown and counts boxes.

staticcategories(WP_Widget $widget, array $instance): string

The categories widget: title, dropdown, counts and hierarchy boxes.

staticrecentPosts(WP_Widget $widget, array $instance): string

The recent posts widget: title, how many, whether to show dates.

staticrecentComments(WP_Widget $widget, array $instance): string

The recent comments widget: title and how many.

staticcustomHtml(WP_Widget $widget, array $instance): string

The custom HTML widget: hidden title and content fields its editor syncs.

staticblock(WP_Widget $widget, array $instance): string

The block widget: its block markup in a textarea.

statictext(WP_Widget $widget, array $instance): string

The text widget in its visual mode: hidden fields the editor syncs (after the indent WP_Widget_Text::form prints first).

statictagCloud(WP_Widget $widget, array $instance): string

The tag cloud: its title, the taxonomies that show a cloud (tags unless one is chosen), and the counts box.

staticnavMenu(WP_Widget $widget, array $instance): string

The navigation menu widget: a note when there are no menus, else the title and the menu to show.

staticrss(array $args, array $inputs): string

wp_widget_rss_form: the feed's address, title, item count (1 to 20, 10 by default) and the three display boxes, each shown unless the caller hides it, and ticked when the settings say so (or, saying nothing, when it is shown).

@param array<string, mixed> $args
@param array<string, bool> $inputs
staticlinks(WP_Widget $widget, array $instance, array $categories, string $limit): string

The Links widget: the link category (the categories given as [id, name]), the sort order, what each link shows, and how many (the limit as the caller shows it).

insidemarked(), number(), id(), name()

WidgetTemplates final class

public/minn/src/Minn/Widgets/WidgetTemplates.php · 77 lines · Open the class →

The Underscore templates the Text and Custom HTML widgets print for their controls (render_control_template_scripts), as the reference prints them (probe widget-methods): a title field and the content area, the Text widget's two hidden pointers, and, for a user who may not post unfiltered HTML, the note on the tags the code editor refuses. The whitespace is the reference's own and is part of the answer.

statictext(): string

The Text widget's template: title, the two pointers, the content area.

staticcustomHtml(): string

The Custom HTML widget's template for a user who may post unfiltered HTML.

staticcustomHtmlRestricted(): string

The Custom HTML widget's template for a user who may not, with the note on refused tags.

insidecustomHtmlWith(), open(), pointer()