Skip to content

Conversation

@gziolo
Copy link
Member

@gziolo gziolo commented Jun 22, 2020

Trac ticket: https://core.trac.wordpress.org/ticket/50263

This patch includes changes added to Gutenberg in:

This is how the interface looks like:

<?php
/**
  * Registers a block type from metadata stored in the `block.json` file.
  *
  * @since 5.5.0
  *
  * @param string $file_or_folder Path to the JSON file with metadata definition for
  *     the block or path to the folder where the `block.json` file is located.
  * @param array  $args {
  *     Optional. Array of block type arguments. Any arguments may be defined, however the
  *     ones described below are supported by default. Default empty array.
  *
  *     @type callable $render_callback Callback used to render blocks of this block type.
  * }
  * @return WP_Block_Type|false The registered block type on success, or false on failure.
  */
function register_block_type_from_metadata( $file_or_folder, $args = array() );

This function is going to be used to register all blocks on the server when backporting the block editor changes in https://core.trac.wordpress.org/ticket/50420.


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.

Copy link
Member

@ocean90 ocean90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DocBlocks needs some minor formatting updates.

@gziolo gziolo requested a review from ocean90 June 23, 2020 05:56
@gziolo
Copy link
Member Author

gziolo commented Jun 23, 2020

@ocean90, is it good to go now? Thank you for review, by the way 👍

Copy link
Member

@ocean90 ocean90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor changes, looks good otherwise.

Co-authored-by: Dominik Schilling <[email protected]>
@gziolo gziolo closed this Jun 23, 2020
@gziolo gziolo deleted the add/register-block-type-metadata branch June 23, 2020 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants