/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/e2e-tests/plugins/meta-attribute-block.php
54 строки
1 KB
Ella
E2e tests: bump all test blocks to API v3 (#74941)
26 янв 2026, 17:30
Не верифицирован
26 янв 2026, 17:30
087ce75
Код
Авторство
О чём код?
<?php /** * Plugin Name: Gutenberg Test Meta Attribute Block * Plugin URI: https://github.com/WordPress/gutenberg * Author: Gutenberg Team * * @package gutenberg-test-meta-attribute-block */ /** * Registers a custom meta for use by the test block. */ function init_test_meta_attribute_block_plugin() { register_meta( 'post', 'my_meta', array( 'show_in_rest' => true, 'single' => true, 'type' => 'string', ) ); } add_action( 'init', 'init_test_meta_attribute_block_plugin' ); /** * Enqueues block assets for the custom meta test block. */ function enqueue_test_meta_attribute_block() { wp_enqueue_script( 'gutenberg-test-meta-attribute-block-early', plugins_url( 'meta-attribute-block/early.js', __FILE__ ), array( 'wp-blocks', 'wp-block-editor', 'wp-element', ), filemtime( plugin_dir_path( __FILE__ ) . 'meta-attribute-block/early.js' ) ); wp_enqueue_script( 'gutenberg-test-meta-attribute-block-late', plugins_url( 'meta-attribute-block/late.js', __FILE__ ), array( 'wp-blocks', 'wp-block-editor', 'wp-element', ), filemtime( plugin_dir_path( __FILE__ ) . 'meta-attribute-block/late.js' ), true ); } add_action( 'enqueue_block_assets', 'enqueue_test_meta_attribute_block' );