apply_filters( 'widget_form_callback', array $instance, WP_Widget $widget )
- Since
- 2.8.0
Filters the widget instance's settings before displaying the control form.
Description
Returning false effectively short-circuits display of the control form.
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
$instancearray- The current widget instance's settings.
$widgetWP_Widget- The current widget instance.
Where this hook fires · 2
wp-includes/class-wp-widget.php:530WP_Widget::form_callback()wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php:582WP_REST_Widget_Types_Controller::get_widget_form()
Source code
<?php * * @since 2.8.0 * * @param array $instance The current widget instance's settings. * @param WP_Widget $widget The current widget instance. */ $instance = apply_filters( 'widget_form_callback', $instance, $this ); $return = null; if ( false !== $instance ) { $return = $this->form( $instance ); Changelog
Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
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.