diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index d2875a003..5f7f33c92 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1190,3 +1190,31 @@ function register_widget_control($name, $control_callback, $width = '', $height function unregister_widget_control($id) { return wp_unregister_widget_control($id); } + +/** + * Output an arbitrary widget as a template tag + * + * @since 2.8 + * + * @param string $widget the widget's PHP class name (see default-widgets.php) + * @param array $instance the widget's instance settings + * @param array $args the widget's sidebar args + * @return void + **/ + +function the_widget($widget, $instance = array(), $args = array()) { + global $wp_widget_factory; + + $widget_obj = $wp_widget_factory->widgets[$widget]; + if ( !is_a($widget_obj, 'WP_Widget') ) + return; + + $before_widget = sprintf('
", 'before_title' => '