WP_Widget::WP_Widget()
Устарела с версии 4.3.0. Больше не поддерживается и может быть удалена. Используйте
__construct()
.PHP4 constructor.
Метод класса: WP_Widget{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WP_Widget = new WP_Widget(); $WP_Widget->WP_Widget( $id_base, $name, $widget_options, $control_options );
- $id_base(строка) (обязательный)
- Base ID for the widget, lowercase and unique. If left empty, a portion of the widget's PHP class name will be used. Has to be unique.
- $name(строка) (обязательный)
- Name for the widget displayed on the configuration page.
- $widget_options(массив)
- Widget options. See wp_register_sidebar_widget() for information on accepted arguments.
По умолчанию: empty array - $control_options(массив)
- Widget control options. See wp_register_widget_control() for information on accepted arguments.
По умолчанию: empty array
Заметки
- Смотрите: WP_Widget::__construct()
Список изменений
С версии 2.8.0 | Введена. |
Устарела с 4.3.0 | Use __construct() instead. |
Код WP_Widget::WP_Widget() WP Widget::WP Widget WP 6.8
public function WP_Widget( $id_base, $name, $widget_options = array(), $control_options = array() ) { _deprecated_constructor( 'WP_Widget', '4.3.0', get_class( $this ) ); WP_Widget::__construct( $id_base, $name, $widget_options, $control_options ); }