WP_Widget::_register()
Register all widget instances of this widget class.
Метод класса: WP_Widget{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WP_Widget = new WP_Widget(); $WP_Widget->_register();
Список изменений
С версии 2.8.0 | Введена. |
Код WP_Widget::_register() WP Widget:: register WP 6.7.1
public function _register() { $settings = $this->get_settings(); $empty = true; // When $settings is an array-like object, get an intrinsic array for use with array_keys(). if ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) { $settings = $settings->getArrayCopy(); } if ( is_array( $settings ) ) { foreach ( array_keys( $settings ) as $number ) { if ( is_numeric( $number ) ) { $this->_set( $number ); $this->_register_one( $number ); $empty = false; } } } if ( $empty ) { // If there are none, we register the widget's existence with a generic template. $this->_set( 1 ); $this->_register_one(); } }