get_block_metadata_i18n_schema() WordPress Function

The get_block_metadata_i18n_schema() function allows you to get the block metadata translation schema for a given block. This is useful for blocks that need to be translated into different languages.

get_block_metadata_i18n_schema() #

Gets i18n schema for block’s metadata read from block.json file.


Return

(object) The schema for block's metadata.


Top ↑

Source

File: wp-includes/blocks.php

function get_block_metadata_i18n_schema() {
	static $i18n_block_schema;

	if ( ! isset( $i18n_block_schema ) ) {
		$i18n_block_schema = wp_json_file_decode( __DIR__ . '/block-i18n.json' );
	}

	return $i18n_block_schema;
}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.