+ $this->rendered_widgets[ $widget['id'] ] = true;
+ }
+
+ /**
+ * Determine if a widget is rendered on the page.
+ *
+ * @since 4.0.0
+ * @access public
+ *
+ * @param string $widget_id Widget ID to check.
+ * @return bool Whether the widget is rendered.
+ */
+ public function is_widget_rendered( $widget_id ) {
+ return in_array( $widget_id, $this->rendered_widgets );
+ }
+
+ /**
+ * Determine if a sidebar is rendered on the page.
+ *
+ * @since 4.0.0
+ * @access public
+ *
+ * @param string $sidebar_id Sidebar ID to check.
+ * @return bool Whether the sidebar is rendered.
+ */
+ public function is_sidebar_rendered( $sidebar_id ) {
+ return in_array( $sidebar_id, $this->rendered_sidebars );