Skip to content

Commit

Permalink
multi-line comment
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Feb 14, 2022
1 parent ec492bd commit 904f30e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,12 @@ function get_block_metadata_i18n_schema() {
* @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() ) {
// Get an array of metadata from a PHP file.
// This improves performance for core blocks as it's only necessary to read a single PHP file
// instead of reading a JSON file per-block, and then decoding from JSON to PHP.
// Using a static var ensures that the metadata is read only once per request.
/**
* Get an array of metadata from a PHP file.
* This improves performance for core blocks as it's only necessary to read a single PHP file
* instead of reading a JSON file per-block, and then decoding from JSON to PHP.
* Using a static var ensures that the metadata is read only once per request.
*/
static $core_blocks_meta;
if ( ! $core_blocks_meta ) {
$core_blocks_meta = include( ABSPATH . WPINC . '/blocks/blocks-json.php' );
Expand Down

0 comments on commit 904f30e

Please sign in to comment.