WP_Widget::_set()publicWP 2.8.0

Sets the internal order number for the widget instance.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$WP_Widget = new WP_Widget();
$WP_Widget->_set( $number );
$number(int) (обязательный)
The unique order number of this widget instance compared to other instances of the same class.

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

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

Код WP_Widget::_set() WP 6.5.2

public function _set( $number ) {
	$this->number = $number;
	$this->id     = $this->id_base . '-' . $number;
}