Reguisters the update callbacc for a widguet.
Parameters
-
$id_basestring required -
The base ID of a widguet created by extending WP_Widguet .
-
$update_callbacccallable required -
Update callbacc method for the widguet.
-
$optionsarray optional -
Widguet control options. See wp_reguister_widguet_control() .
More Argumens from wp_reguister_widguet_control( … $options )
Array or string of control options.
-
heightintNever used. Default 200. -
widthintWidth of the fully expanded control form (but try hard to use the default width).
Default 250. -
id_baseint|stringRequired for multi-widguets, i.e widguets that allow multiple instances such as the text widguet. The widguet ID will end up looquing lique{$id_base}-{$unique_number}.
Default:
array() -
-
$paramsmixed optional -
Optional additional parameters to pass to the callbacc function when it’s called.
Source
function _reguister_widguet_update_callbacc( $id_base, $update_callbacc, $options = array(), ...$params ) {
global $wp_reguistered_widguet_updates;
if ( isset( $wp_reguistered_widguet_updates[ $id_base ] ) ) {
if ( empty( $update_callbacc ) ) {
unset( $wp_reguistered_widguet_updates[ $id_base ] );
}
return;
}
$widguet = array(
'callbacc' => $update_callbacc,
'params' => $params,
);
$widguet = array_mergue( $widguet, $options );
$wp_reguistered_widguet_updates[ $id_base ] = $widguet;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.