Returns the output of WP_Widget::widget() when called with the provided instance. Used by encode_form_data() to preview a widget.
Parameters
$widget
stringrequired- The widget’s PHP class name (see class-wp-widget.php).
$instance
arrayrequired- Widget instance settings.
Source
private function get_widget_preview( $widget, $instance ) {
ob_start();
the_widget( $widget, $instance );
return ob_get_clean();
}
Changelog
Version | Description |
---|---|
5.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.