/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/e2e-tests/plugins/templates.php
57 строк
1 KB
Andrew Duthie
Add Columns template options, support InnerBlock templateOptions (#16129)
24 июн 2019, 20:33
24 июн 2019, 20:33
855be79
Код
Авторство
О чём код?
<?php /** * Plugin Name: Gutenberg Test Plugin, Templates * Plugin URI: https://github.com/WordPress/gutenberg * Author: Gutenberg Team * * @package gutenberg-test-templates */ /** * Registers a book CPT with a template */ function gutenberg_test_templates_register_book_type() { $args = array( 'public' => true, 'label' => 'Books', 'show_in_rest' => true, 'template' => array( array( 'core/image' ), array( 'core/paragraph', array( 'placeholder' => 'Add a book description', ), ), array( 'core/quote' ), array( 'core/columns', array( 'columns' => 2 ), array( array( 'core/column', array(), array( array( 'core/image' ), ), ), array( 'core/column', array(), array( array( 'core/paragraph', array( 'placeholder' => 'Add a inner paragraph', ), ), ), ), ), ), ), ); register_post_type( 'book', $args ); } add_action( 'init', 'gutenberg_test_templates_register_book_type' );