WordPress at a glance
function is not described

WP_Customize_Widgets::sanitize_widget_js_instance() public WP 3.9.0

Converts a widget instance into JSON-representable format.

It's a method of the class: WP_Customize_Widgets{}

No Hooks.

Return

Array. JSON-converted widget instance.

Usage

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->sanitize_widget_js_instance( $value );
$value(array) (required)
Widget instance to convert to JSON.

Changelog

Since 3.9.0 Introduced.

Code of WP_Customize_Widgets::sanitize_widget_js_instance() WP 5.5.1

<?php
public function sanitize_widget_js_instance( $value ) {
	if ( empty( $value['is_widget_customizer_js_value'] ) ) {
		$serialized = serialize( $value );

		$value = array(
			'encoded_serialized_instance'   => base64_encode( $serialized ),
			'title'                         => empty( $value['title'] ) ? '' : $value['title'],
			'is_widget_customizer_js_value' => true,
			'instance_hash_key'             => $this->get_instance_hash_key( $serialized ),
		);
	}
	return $value;
}