Commit Graph

6 Commits

Author SHA1 Message Date
Jonathan Desrosiers 572207384b Block Editor: Update `@wordpress` dependencies.
Changes of note:

- Includes the new Annotations API package.
- `wp-polyfill-ecmascript.js` is renamed to `wp-polyfill.js`.
- `strip_dynamic_blocks()` has been removed in favor of `excerpt_remove_blocks()`.
- The PHP block parser is now syncing from the `block-serialization-default-parser` package.
- `do_blocks()` uses the new parser.
- The `do_block` filter has been removed from `do_blocks()`, in favor of a `render_block` filter in `render_block()`.

Also, a little cleanup to `render_block()`. Always normalize `$block['attrs’]` to array in `’render_block’` filter.
Props pento, azaozz.

Merges [43884] and [43888] to trunk.

See #45145, #45190, #45264, #45282.

git-svn-id: https://develop.svn.wordpress.org/trunk@44261 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 04:50:48 +00:00
Anton Timmermans 9c6f855dbf Tests: Fix failing unit tests caused by [43840].
Props pento.
Merges [43841] to trunk.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/trunk@44179 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 11:22:41 +00:00
Gary Pendergast dc6b225023 Build Tools: Update the `@wordpress/*` packages.
Merges [43801,43803] from the 5.0 branch to trunk.

See #45145.



git-svn-id: https://develop.svn.wordpress.org/trunk@44163 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 04:42:55 +00:00
Jonathan Desrosiers 93091fac36 Blocks: Parse blocks when displaying posts.
Posts containing blocks are now correctly handled when displaying on the front end, including dynamic blocks and nested blocks.

Props pento.

Merges [43752] to trunk.

See #45109.

git-svn-id: https://develop.svn.wordpress.org/trunk@44118 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 18:11:10 +00:00
Jonathan Desrosiers f8c9698722 Blocks: Introduce the block parser.
The `WP_Block_Parser` class, and the accompanying `parse_blocks()` helper function, can be used to parse an array of blocks out of a content string.

`WP_Block_Parser` is copied from the `@wordpress/block-serialization-default-parser` package. To ensure it stays in sync with the JavaScript parser, changes should be implemented in the package first, then the package version should be upgraded to include the changes.

Props pento.

Merges [43751] to trunk.

See #45109.

git-svn-id: https://develop.svn.wordpress.org/trunk@44116 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 17:39:59 +00:00
Gary Pendergast 738609ae9c Blocks: Introduce `register_block_type()`, `unregister_block_type()`, and `get_dynamic_blocks()` functions.
These helper functions allow easy access to the global block registry.

Merges [43743] from the 5.0 branch to trunk.

See #45109.


git-svn-id: https://develop.svn.wordpress.org/trunk@44109 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 09:53:10 +00:00