A WordPress-centric search engine for devs and theme authors



register_block_core_search ›

Sincen/a
Deprecatedn/a
register_block_core_search ( No parameters )
Defined at:
Codex:

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



Source

function 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' => 'render_block_core_search',
		)
	);
}