wpdevel.wordpress.com wpdevel.wordpress.com

REST API Changes in WordPress 5.7

The following is a snapshot of some of the changes to the REST API in WordPress 5.7. For more details, see the full list of closed tickets. Endpoint Changes Posts Collection Tax Query Accepts include_children Introduced in 50157, the REST API posts collection endpoints have been updated to allow a more complex syntax for specifying the tax_query used when querying posts. Each taxonomy’s query parameters can now both accept a list...

wpdevel.wordpress.com wpdevel.wordpress.com

Introducing script attributes related functions in WordPress 5.7

WordPress 5.7 adds a handful of new functions that enables passing attributes, such as async or nonce, to both regular and inline script tag attributes. This creates a path forward for enabling a Content-Security-Policy (or CSP) in Core, plugins, and themes. These new functions are: wp_get_script_tag() – Formats <script> loader tags and automatically injects a type attribute (if needed).wp_print_script_tag() – Prints a...

wpdevel.wordpress.com wpdevel.wordpress.com

Editor chat summary: Wednesday, 17 February 2021

This post summarizes the latest weekly Editor meeting (agenda, slack transcript), held in the #core-editor Slack channel, on Wednesday, February 17, 2021, 14:00 UTC. Thank you to all of the contributors who tested the Beta releases and gave feedback. Testing for bugs is a critical part of polishing every release and a great way to contribute to WordPress. WordPress 5.7 Beta 3 WordPress 5.7 Beta 3 is now available for testing! Gutenberg...

wpdevel.wordpress.com wpdevel.wordpress.com

Feature Plugin: Rollback Update Failure

This feature plugin is an offshoot of Matt’s 9 Projects for 2019. Specifically it’s a follow-up to auto-updates for plugins and themes. Our goal is to provide a safety mechanism of sorts should an update, including auto-updates, fail potentially leaving the user’s site in an unstable state. This is a feature plugin based on the PR for #51857. We are working towards inclusion in WordPress 5.8. The general overview is to provide a...

wpdevel.wordpress.com wpdevel.wordpress.com

CSS Chat Summary: 18 February 2021

The meeting took place here on Slack. @notlaura facilitated and @danfarrow wrote up these notes. Housekeeping @ryelle volunteered to run next week’s bug scrub (Thursday 25 February @ 21:00 UTC) – thanks @ryelle!Discussion: Deprecation flow for base styles Last week’s bug scrub brought up this Gutenberg issue about an SCSS variable that was removed from the wordpress/base-styles npm packageThe issue asks if a deprecation policy...

wpdevel.wordpress.com wpdevel.wordpress.com

Introducing additional functions to check if a post is publicly viewable in WordPress 5.7

WordPress 5.7 introduces two additional functions to check if a post is publicly viewable. Previously, the is_post_type_viewable() function was already available to determine if a post type is visible to anonymous users via the publicly_queryable setting when registering the post type. However, it wasn’t sufficient to determine if a specific post is viewable as this function only checks for general post type settings. That’s...

wpdevel.wordpress.com wpdevel.wordpress.com

WordPress 5.7: A new dynamic hook to filter the content of a single block

The render_block() function is responsible for rendering each individual block into an HTML string. There are several filters available that allow plugins and themes to alter how the block is rendered. pre_render_block: Allows render_block() to be short-circuited, by returning a non-null value.render_block_data: Filters the block being rendered in render_block(), before it’s processed.render_block_content: Filters the default context...