WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Customize_Widgets::is_wide_widget() public WP 3.9.0

Determines whether the widget is considered "wide".

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

Core widgets which may have controls wider than 250, but can still be shown in the narrow Customizer panel. The RSS and Text widgets in Core, for example, have widths of 400 and yet they still render fine in the Customizer panel.

This method will return all Core widgets as being not wide, but this can be overridden with the is_wide_widget_in_customizer filter.

{} Это метод класса: WP_Customize_Widgets{}

Хуки из метода

Возвращает

true|false. Whether or not the widget is a "wide" widget.

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

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->is_wide_widget( $widget_id );
$widget_id(строка) (обязательный)
Widget ID.

Заметки

  • Global. Массив. $wp_registered_widget_controls

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

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

Код WP_Customize_Widgets::is_wide_widget() WP 5.8.2

public function is_wide_widget( $widget_id ) {
	global $wp_registered_widget_controls;

	$parsed_widget_id = $this->parse_widget_id( $widget_id );
	$width            = $wp_registered_widget_controls[ $widget_id ]['width'];
	$is_core          = in_array( $parsed_widget_id['id_base'], $this->core_widget_id_bases, true );
	$is_wide          = ( $width > 250 && ! $is_core );

	/**
	 * Filters whether the given widget is considered "wide".
	 *
	 * @since 3.9.0
	 *
	 * @param bool   $is_wide   Whether the widget is wide, Default false.
	 * @param string $widget_id Widget ID.
	 */
	return apply_filters( 'is_wide_widget_in_customizer', $is_wide, $widget_id );
}