Skip to content

Commit

Permalink
Block Library: Post: Register from metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 25, 2020
1 parent 4a66f73 commit 5238269
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions packages/block-library/src/post/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,11 @@
* Registers the `core/post` block on the server.
*/
function register_block_core_post() {
$path = __DIR__ . '/post/block.json';
$metadata = json_decode( file_get_contents( $path ), true );
register_block_type(
'core/post',
array(
'attributes' => array(
'postType' => array(
'type' => 'string',
'context' => true,
),
'postId' => array(
'type' => 'string',
'context' => true,
),
),
)
$metadata['name'],
$metadata
);
}
add_action( 'init', 'register_block_core_post' );

0 comments on commit 5238269

Please sign in to comment.