WP_Customize_Widgets::filter_sidebars_widgets_for_rendering_widget() WordPress Method

The WP_Customize_Widgets::filter_sidebars_widgets_for_rendering_widget() method is used to filter the list of widgets that should be rendered in a sidebar. This is useful for ensuring that only the widgets that are relevant to the current context are rendered.

WP_Customize_Widgets::filter_sidebars_widgets_for_rendering_widget( array $sidebars_widgets ) #

Filters sidebars_widgets to ensure the currently-rendered widget is the only widget in the current sidebar.


Parameters

$sidebars_widgets

(array)(Required)Sidebars widgets.


Top ↑

Return

(array) Filtered sidebars widgets.


Top ↑

Source

File: wp-includes/class-wp-customize-widgets.php

	public function filter_sidebars_widgets_for_rendering_widget( $sidebars_widgets ) {
		$sidebars_widgets[ $this->rendering_sidebar_id ] = array( $this->rendering_widget_id );
		return $sidebars_widgets;
	}

Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More