do_action_ref_array( 'in_widget_form', WP_Widget $widget, null|string $return, array $instance )
- Since
- 2.8.0
Fires at the end of the widget control form.
Description
Use this hook to add extra fields to the widget form. The hook is only fired if the value passed to the 'widget_form_callback' hook is not false.
Note: If the widget has no form, the text echoed from the default form method can be hidden using CSS.
Compatibility
- WordPress
- since 2.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$widgetWP_Widget- The widget instance (passed by reference).
$returnnull|string- Default 'noform'. Return null if new fields are added.
$instancearray- An array of the widget's settings.
Where this hook fires · 2
wp-includes/class-wp-widget.php:553WP_Widget::form_callback()wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php:592WP_REST_Widget_Types_Controller::get_widget_form()
Source code
<?php * @since 2.8.0 * * @param WP_Widget $widget The widget instance (passed by reference). * @param null|string $return Default 'noform'. Return null if new fields are added. * @param array $instance An array of the widget's settings. */ do_action_ref_array( 'in_widget_form', array( &$this, &$return, $instance ) ); } return $return; } /**Changelog
Introduced in 2.8.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Parameter
$return retyped from null to null|string.verified against source2.8.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.