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.
Contents
Parameters
- $widget_id
(string)(Required)Widget ID to check.
Return
(bool) Whether the widget is rendered.
Source
File: wp-includes/class-wp-customize-widgets.php
public function is_widget_rendered( $widget_id ) { return ! empty( $this->rendered_widgets[ $widget_id ] ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.0.0 | Introduced. |