WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Customize_Widgets::sanitize_widget_instance() public WP 3.9.0

Sanitizes a widget instance.

Unserialize the JS-instance for storing in the options. It's important that this filter only get applied to an instance once.

Это метод класса: WP_Customize_Widgets{}

Хуков нет.

Возвращает

Массив/null. Sanitized widget instance.

Использование

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->sanitize_widget_instance( $value );
$value(массив) (обязательный)
Widget instance to sanitize.

Список изменений

С версии 3.9.0 Введена.

Код WP_Customize_Widgets::sanitize_widget_instance() WP 5.5.1

wp-includes/class-wp-customize-widgets.php
<?php
public function sanitize_widget_instance( $value ) {
	if ( array() === $value ) {
		return $value;
	}

	if ( empty( $value['is_widget_customizer_js_value'] )
		|| empty( $value['instance_hash_key'] )
		|| empty( $value['encoded_serialized_instance'] ) ) {
		return;
	}

	$decoded = base64_decode( $value['encoded_serialized_instance'], true );
	if ( false === $decoded ) {
		return;
	}

	if ( ! hash_equals( $this->get_instance_hash_key( $decoded ), $value['instance_hash_key'] ) ) {
		return;
	}

	$instance = unserialize( $decoded );
	if ( false === $instance ) {
		return;
	}

	return $instance;
}