WP_Widget_Media::__construct()
Constructor.
Метод класса: WP_Widget_Media{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WP_Widget_Media = new WP_Widget_Media(); $WP_Widget_Media->__construct( $id_base, $name, $widget_options, $control_options );
- $id_base(строка) (обязательный)
- Base ID for the widget, lowercase and 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
Список изменений
С версии 4.8.0 | Введена. |
Код WP_Widget_Media::__construct() WP Widget Media:: construct WP 6.7.2
public function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) { $widget_opts = wp_parse_args( $widget_options, array( 'description' => self::get_default_description(), 'customize_selective_refresh' => true, 'show_instance_in_rest' => true, 'mime_type' => '', ) ); $control_opts = wp_parse_args( $control_options, array() ); $this->l10n = array_merge( self::get_l10n_defaults(), array_filter( $this->l10n ) ); parent::__construct( $id_base, $name, $widget_opts, $control_opts ); }