Repository navigation
REST API: Introduce Plugins and Block Directory endpoint - #359
TimothyBJacobs wants to merge 9 commits into
Conversation
| 'icon' => ( isset( $plugin['icons']['1x'] ) ? $plugin['icons']['1x'] : 'block-default' ), | ||
| 'assets' => array(), | ||
| 'last_updated' => $plugin['last_updated'], | ||
| 'humanized_updated' => sprintf( |
There was a problem hiding this comment.
I would like to remove this, but this is blocked by WordPress/gutenberg#14486.
There was a problem hiding this comment.
Yeah agreed. We can drop it in future I guess.
dd32
left a comment
There was a problem hiding this comment.
A visual read through looks good to me.
I've also gone through all the permission checks, and once again, at a visual level they all look as I would expect.
Switches to the "Link Manager" plugin. Skips downloading the package and uses a filter to provide a direct download.
|
We'll also need a PR to update Gutenberg to use the |
|
@TimothyBJacobs Can we keep everything experimental? Or are these APIs fully ready? |
|
Thoughts on shipping experimental endpoints in core are mixed so I'm not really sure about shipping experimental endpoints in general. For this endpoint in particular, I don't think it needs to be shipped as experimental. |
| // There might be multiple blocks in a plugin. Only the first block is mapped. | ||
| $block_data = reset( $plugin['blocks'] ); |
There was a problem hiding this comment.
Probably a question for @tellyworth — How will we ensure the right block is imported here? I know Listicles is an example of this, it pulls out the List Item child block instead of the main Listicles block. The wp.org endpoint could return parent, and we filter out based on the current block, or maybe it only returns blocks with no parent?
|
Created a PR for updating the namespaces in Gutenberg: WordPress/gutenberg#23528 I tested out the endpoints, and once I got this PR done ^, I was able to test out using the block directory — it all worked as expected. |
…for the prepare item test.
Original Gutenberg PR: WordPress/gutenberg#22454
This also introduces a change in
plugins_apito not perform a trigger error if this is a json request since we don't want that to break the JSON output.Trac ticket: https://core.trac.wordpress.org/ticket/50321
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.