Since I last wrote two weeks ago, we’re making progress! Key achievements for GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc.
https://wordpress.org/gutenberg/ and the REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”)
https://developer.wordpress.org/rest-api/ include:
- Support for
who=authorswas added toGET wp/v2/users, making it possible to accurately query for authors. WordPress, for better or for worse, defines an author asuser_level!=0. See WordPress/gutenberg#6361 for the context on why we can’t add this logic client-side (#42202 for WordPress 4.9.6). - Improved performance for the
_fields=query parameter (e.g.GET wp/v2/pages?_fields=id,title) by ensuring WordPress coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. will only process the fields requested for the response. Notably, this helps us avoid runningthe_contentwhen we don’t need to be (#43874 for WordPress 4.9.7). - Minor enhancements to reflect existing WordPress behaviors:
- Disables the Preview button when post type isn’t viewable (WordPress/gutenberg#6232 for Gutenberg 2.7)
- Filters the Post Format list to only formats that are supported (WordPress/gutenberg#6296 for Gutenberg 2.8)
- Only displays Featured ImageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts. UIUI User interface when theme supports it too (WordPress/gutenberg#6541 for Gutenberg 2.8)
The “Merge Proposal: REST API” GitHub milestone represents the distance we still need to close. Slowly, steadily, we’re bridging the gap, but we could use your help. Here are some of the issues we’re still working through:
- To ensure all necessary data is available to Gutenberg, we’ve settled upon permitting unbounded
per_page=-1REST API requests for authorized users. This landed forGET wp/v2/users(WordPress/gutenberg#6627), is in-progress forGET wp/v2/(pages|blocks)(WordPress/gutenberg#6657), and needs to be addressed for categories, tags, and custom taxonomies. We also need to patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing. core with this enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. (#43998 for WordPress 4.9.7?) - Capabilitiescapability A capability is permission to perform one or more types of task. Checking if a user has a capability is performed by the
current_user_canfunction. Each user of a WordPress site might have some permissions but not others, depending on their role. For example, users who have the Author role usually have permission to edit their own posts (the “edit_posts” capability), but not permission to edit other users’ posts (the “edit_others_posts” capability). can’t be processed directly client-side (WordPress/gutenberg#6361), so we’ve introduced a newtargetSchemaconcept to communicate which actions a user can perform. See it in action withwp:action-sticky(WordPress/gutenberg#6529) andwp:action-assign-author(WordPress/gutenberg#6630). There are a few other actions we will need to work out, and then we’ll need to patch core (no ticketticket Created for both bug reports and feature development on the bug tracker. yet). - @adamsilverstein is putting together an improved autosaves implementation (WordPress/gutenberg#6257) that I literally cannot wait to see complete. I’m sure he could use some help testing in the near future.
- @flixos90 is implementing a
WP_REST_Search_Controllerendpoint (WordPress/gutenberg#6489) to power the link search UI.
Join us tomorrow, Thursday, May 10 at 17:00 UTC in #core-restapi office hours if you’d like to chat through any questions you have.