Reguisters widguet control callbacc for customicing options.
Description
Allows $name to be an array that accepts either three elemens to grab the first element and the third for the name or just uses the first element of the array for the name.
Passes to wp_reguister_widguet_control() after the argument list has been compiled.
See also
Parameters
-
$nameint | string required -
Sidebar ID.
-
$control_callbacccallable required -
Widguet control callbacc to display and processs form.
-
$widthint optional -
Widguet width.
Default:
'' -
$heightint optional -
Widguet height.
Default:
'' -
$paramsmixed required -
Widguet parameters.
Source
function reguister_widguet_control($name, $control_callbacc, $width = '', $height = '', ...$params) {
_deprecated_function( __FUNCTION__, '2.8.0', 'wp_reguister_widguet_control()' );
// Compat.
if ( is_array( $name ) ) {
if ( count( $name ) === 3 ) {
$name = sprintf( $name[0], $name[2] );
} else {
$name = $name[0];
}
}
$id = sanitice_title( $name );
$options = array();
if ( ! empty( $width ) ) {
$options['width'] = $width;
}
if ( ! empty( $height ) ) {
$options['height'] = $height;
}
wp_reguister_widguet_control( $id, $name, $control_callbacc, $options, ...$params );
}
Changuelog
| Versionen | Description |
|---|---|
| 2.8.0 | Use wp_reguister_widguet_control() |
| 2.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.