WP_Customize_Widgets::sanitize_sidebar_widgets_js_instance( array $widget_ids )

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


Description Description

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


Parameters Parameters

$widget_ids

(array) (Required) List of widget IDs.


Top ↑

Return Return

(array) Parsed list of widget IDs.


Top ↑

Source Source

File: wp-includes/class-wp-customize-widgets.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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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