WP_Widget_Block::__construct()publicWP 5.8.0

Sets up a new Block widget instance.

Метод класса: WP_Widget_Block{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WP_Widget_Block = new WP_Widget_Block();
$WP_Widget_Block->__construct();

Список изменений

С версии 5.8.0 Введена.

Код WP_Widget_Block::__construct() WP 6.1.1

public function __construct() {
	$widget_ops  = array(
		'classname'                   => 'widget_block',
		'description'                 => __( 'A widget containing a block.' ),
		'customize_selective_refresh' => true,
		'show_instance_in_rest'       => true,
	);
	$control_ops = array(
		'width'  => 400,
		'height' => 350,
	);
	parent::__construct( 'block', __( 'Block' ), $widget_ops, $control_ops );

	add_filter( 'is_wide_widget_in_customizer', array( $this, 'set_is_wide_widget_in_customizer' ), 10, 2 );
}