You are here

function gutenberg_register_block_core_search in Gutenberg 8

Same name and namespace in other branches
  1. 8.2 vendor/gutenberg/block-library/blocks/search.php \gutenberg_register_block_core_search()

Registers the `core/search` block on the server.

1 string reference to 'gutenberg_register_block_core_search'
search.php in vendor/gutenberg/block-library/blocks/search.php

File

vendor/gutenberg/block-library/blocks/search.php, line 64

Code

function gutenberg_register_block_core_search() {
  register_block_type('core/search', array(
    'attributes' => array(
      'align' => array(
        'type' => 'string',
        'enum' => array(
          'left',
          'center',
          'right',
          'wide',
          'full',
        ),
      ),
      'className' => array(
        'type' => 'string',
      ),
      'label' => array(
        'type' => 'string',
        'default' => __('Search'),
      ),
      'placeholder' => array(
        'type' => 'string',
        'default' => '',
      ),
      'buttonText' => array(
        'type' => 'string',
        'default' => __('Search'),
      ),
    ),
    'render_callback' => 'gutenberg_render_block_core_search',
  ));
}