WordPress at a glance
функция не описана

WP_Customize_Widgets::sanitize_sidebar_widgets_js_instance() public WP 3.9.0

Strips out widget IDs for widgets which are no longer registered.

One example where this might happen is when a plugin orphans a widget in a sidebar upon deactivation.

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

Хуков нет.

Возвращает

Array. Parsed list of widget IDs.

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

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->sanitize_sidebar_widgets_js_instance( $widget_ids );
$widget_ids(array) (required)
List of widget IDs.

Заметки

  • Global. Array. $wp_registered_widgets

Changelog

Since 3.9.0 Introduced.

Код WP_Customize_Widgets::sanitize_sidebar_widgets_js_instance() WP 5.5.1

<?php
public function sanitize_sidebar_widgets_js_instance( $widget_ids ) {
	global $wp_registered_widgets;
	$widget_ids = array_values( array_intersect( $widget_ids, array_keys( $wp_registered_widgets ) ) );
	return $widget_ids;
}