A WordPress-centric search engine for devs and theme authors



register_block_core_latest_comments ›

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

Registers the `core/latest-comments` block.



Source

function register_block_core_latest_comments() {
	register_block_type(
		'core/latest-comments',
		array(
			'attributes'      => array(
				'align'          => array(
					'type' => 'string',
					'enum' => array(
						'left',
						'center',
						'right',
						'wide',
						'full',
					),
				),
				'className'      => array(
					'type' => 'string',
				),
				'commentsToShow' => array(
					'type'    => 'number',
					'default' => 5,
					'minimum' => 1,
					'maximum' => 100,
				),
				'displayAvatar'  => array(
					'type'    => 'boolean',
					'default' => true,
				),
				'displayDate'    => array(
					'type'    => 'boolean',
					'default' => true,
				),
				'displayExcerpt' => array(
					'type'    => 'boolean',
					'default' => true,
				),
			),
			'render_callback' => 'render_block_core_latest_comments',
		)
	);
}