Title: register_widget_control
Published: April 25, 2014
Last modified: February 24, 2026

---

# register_widget_control( int|string $name, callable $control_callback, int $width, int $height, mixed $params )

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#wp--skip-link--target)

This function has been deprecated since 2.8.0. Use [wp_register_widget_control()](https://developer.wordpress.org/reference/functions/wp_register_widget_control/)
instead.

Registers widget control callback for customizing options.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#description)󠁿

Allows $name to be an array that accepts either three elements 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_register_widget_control()](https://developer.wordpress.org/reference/functions/wp_register_widget_control/)
after the argument list has been compiled.

### 󠀁[See also](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#see-also)󠁿

 * [wp_register_widget_control()](https://developer.wordpress.org/reference/functions/wp_register_widget_control/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#parameters)󠁿

 `$name`int|stringrequired

Sidebar ID.

`$control_callback`callablerequired

Widget control callback to display and process form.

`$width`intrequired

Widget width.

`$height`intrequired

Widget height.

`$params`mixedrequired

Widget parameters.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#source)󠁿

    ```php
    function register_widget_control($name, $control_callback, $width = '', $height = '', ...$params) {
    	_deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_widget_control()' );
    	// Compat.
    	if ( is_array( $name ) ) {
    		if ( count( $name ) === 3 ) {
    			$name = sprintf( $name[0], $name[2] );
    		} else {
    			$name = $name[0];
    		}
    	}

    	$id      = sanitize_title( $name );
    	$options = array();
    	if ( ! empty( $width ) ) {
    		$options['width'] = $width;
    	}
    	if ( ! empty( $height ) ) {
    		$options['height'] = $height;
    	}

    	wp_register_widget_control( $id, $name, $control_callback, $options, ...$params );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/deprecated.php#L2178)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/deprecated.php#L2178-L2199)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#related)󠁿

| Uses | Description | 
| [sanitize_title()](https://developer.wordpress.org/reference/functions/sanitize_title/)`wp-includes/formatting.php` |

Sanitizes a string into a slug, which can be used in URLs or HTML attributes.

  | 
| [wp_register_widget_control()](https://developer.wordpress.org/reference/functions/wp_register_widget_control/)`wp-includes/widgets.php` |

Registers widget control callback for customizing options.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/register_widget_control/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Deprecated. Use [wp_register_widget_control()](https://developer.wordpress.org/reference/functions/wp_register_widget_control/)  | 
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fregister_widget_control%2F)
before being able to contribute a note or feedback.