WP_Customize_Widgets::is_widget_rendered() WordPress Method

The WP_Customize_Widgets::is_widget_rendered() method is used to check if a given widget is rendered on the front-end of the site. This is useful for determining if a widget is active and visible to the site's visitors.

WP_Customize_Widgets::is_widget_rendered( string $widget_id ) #

Determine if a widget is rendered on the page.


Parameters

$widget_id

(string)(Required)Widget ID to check.


Top ↑

Return

(bool) Whether the widget is rendered.


Top ↑

Source

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

	public function is_widget_rendered( $widget_id ) {
		return ! empty( $this->rendered_widgets[ $widget_id ] );
	}

Top ↑

Changelog

Changelog
VersionDescription
4.0.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