WP_Widget::_set() WordPress Method

The WP_Widget::_set() method is used to set the value of a widget property. The method takes two arguments: the property name and the property value. The property value can be either a string or an array.

WP_Widget::_set( int $number ) #

Sets the internal order number for the widget instance.


Parameters

$number

(int)(Required)The unique order number of this widget instance compared to other instances of the same class.


Top ↑

Source

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

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


Top ↑

Changelog

Changelog
VersionDescription
2.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.