Returns the output of WP_Widget::form() when called with the provided instance. Used by encode_form_data() to preview a widget’s form.
Parameters
$widget_object
WP_Widgetrequired- Widget object to call widget() on.
$instance
arrayrequired- Widget instance settings.
Source
private function get_widget_form( $widget_object, $instance ) {
ob_start();
/** This filter is documented in wp-includes/class-wp-widget.php */
$instance = apply_filters(
'widget_form_callback',
$instance,
$widget_object
);
if ( false !== $instance ) {
$return = $widget_object->form( $instance );
/** This filter is documented in wp-includes/class-wp-widget.php */
do_action_ref_array(
'in_widget_form',
array( &$widget_object, &$return, $instance )
);
}
return ob_get_clean();
}
Hooks
- do_action_ref_array( ‘in_widget_form’,
WP_Widget $widget ,null $return ,array $instance ) Fires at the end of the widget control form.
- apply_filters( ‘widget_form_callback’,
array $instance ,WP_Widget $widget ) Filters the widget instance’s settings before displaying the control form.
Changelog
Version | Description |
---|---|
5.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.