API / Minn\Rest / BlockDirectoryController

BlockDirectoryController final readonly class

Minn\Rest\BlockDirectoryController · public/minn/src/Minn/Rest/BlockDirectoryController.php · 72 lines

wp/v2/block-directory/search (Austin, 2026-10-21, decision 1B): the directory's block plugins for a term, asked as plugins_api asks (its filters run) of wordpress.org through the Minn update service. The term is required before the caller is judged; then only someone who may install and activate plugins searches. A plugin with blocks is one item, named for its first block: its short description as the directory words it, ratings out of five, the author's name without its link, the last update as a date and as how long ago, and a link to install it.

Used by 1

Constants and properties

privateREFUSAL = 'Sorry, you are not allowed to browse the block directory.'
privateARGS = array ( 'context' => array ( 'description' => 'Scope under which the request is made; determines fields present in response.', 'type' => 'string', 'enum' => array ( 0 => 'view', ), 'default' => 'view', 'required' => false, ), 'page' => array ( 'description' => 'Current page of the collection.', 'type' => 'integer', 'default' => 1, 'minimum' => 1, 'required' => false, ), 'per_page' => array ( 'description' => 'Maximum number of items to be returned in result set.', 'type' => 'integer', 'default' => 10, 'minimum' => 1, 'maximum' => 100, 'required' => false, ), 'term' => array ( 'description' => 'Limit result set to blocks matching the search term.', 'type' => 'string', 'minLength' => 1, 'required' => true, ), )
privatereadonly Minn\Rest\RestUrl $url

Promoted from the constructor.

Public

new__construct(Minn\Rest\RestUrl $url)#
methodsearch(Minn\Http\Request $request): Minn\Http\ResponseGET /wp/v2/block-directory/search (cap install_plugins + activate_plugins)#

The block plugins matching a term, a page at a time.

Internals 1

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

privateitem(array $plugin, array $block): array#

One plugin as the search shows it.

$pluginarray<string, mixed>
$blockarray<string, mixed>
@return array<string, mixed>