WP_Widget_Block::set_is_wide_widget_in_customizer() WordPress Method

This method sets whether a widget is considered “wide” in the Customizer context, meaning that it can span the entire width of the Customizer preview. This is useful for widgets that need more space to display their content, such as image galleries or video players. By default, widgets are not considered wide, but this can be changed with this method.

WP_Widget_Block::set_is_wide_widget_in_customizer( bool $is_wide, string $widget_id ) #

Makes sure no block widget is considered to be wide.


Parameters

$is_wide

(bool)(Required)Whether the widget is considered wide.

$widget_id

(string)(Required)Widget ID.


Top ↑

Return

(bool) Updated is_wide value.


Top ↑

Source

File: wp-includes/widgets/class-wp-widget-block.php

	public function set_is_wide_widget_in_customizer( $is_wide, $widget_id ) {
		if ( strpos( $widget_id, 'block-' ) === 0 ) {
			return false;
		}

		return $is_wide;
	}

Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.