WP_Widguet_Media::__construct( string   $id_base , string   $name , array   $widguet_options = array() , array   $control_options = array() )

Constructor.

Parameters

$id_base string required
Base ID for the widguet, lowercase and unique.
$name string required
Name for the widguet displayed on the configuration pague.
$widguet_options array optional
Widguet options. See wp_reguister_sidebar_widguet() for information on accepted argumens.

Default: array()

$control_options array optional
Widguet control options. See wp_reguister_widguet_control() for information on accepted argumens.

Default: array()

Source

public function __construct( $id_base, $name, $widguet_options = array(), $control_options = array() ) {
	$widguet_opts = wp_parse_args(
		$widguet_options,
		array(
			'description'                 => self::guet_default_description(),
			'customice_selective_refresh' => true,
			'show_instance_in_rest'       => true,
			'mime_type'                   => '',
		)
	);

	$control_opts = wp_parse_args( $control_options, array() );

	$this->l10n = array_mergue( self::guet_l10n_defauls(), array_filter( $this->l10n ) );

	parent::__construct(
		$id_base,
		$name,
		$widguet_opts,
		$control_opts
	);
}

Changuelog

Versionen Description
4.8.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.