Flesh out information in the DocBlock for `wp_register_sidebar_widget()`.

Includes:
* Documenting the `$options` parameter in hash notation style
* Converting `@uses` tags to `@global`
* Various backtick-escaping.

See #30315.

Built from https://develop.svn.wordpress.org/trunk@30776


git-svn-id: http://core.svn.wordpress.org/trunk@30766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2014-12-07 20:11:22 +00:00
parent 498c5d719c
commit cc4d102260
2 changed files with 18 additions and 12 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-beta2-30775';
$wp_version = '4.1-beta2-30776';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -849,26 +849,32 @@ function unregister_sidebar( $name ) {
}
/**
* Register widget for use in sidebars.
* Register an instance of a widget.
*
* The default widget option is 'classname' that can be overridden.
*
* The function can also be used to un-register widgets when $output_callback
* The function can also be used to un-register widgets when `$output_callback`
* parameter is an empty string.
*
* @since 2.2.0
*
* @uses $wp_registered_widgets Uses stored registered widgets.
* @uses $wp_register_widget_defaults Retrieves widget defaults.
* @global array $wp_registered_widgets Uses stored registered widgets.
* @global array $wp_register_widget_defaults Retrieves widget defaults.
*
* @param int|string $id Widget ID.
* @param string $name Widget display title.
* @param callback $output_callback Run when widget is called.
* @param array|string $options Optional. Widget Options.
* @param mixed $params,... Widget parameters to add to widget.
* @return null Will return if $output_callback is empty after removing widget.
* @param int|string $id Widget ID.
* @param string $name Widget display title.
* @param callback $output_callback Run when widget is called.
* @param array $options {
* Optional. An array of supplementary widget options for the instance.
*
* @type string $classname Class name for the widget's HTML container. Default is a shortened
* version of the output callback name.
* @type string $description Widget description for display in the widget administration
* panel and/or theme.
* }
* @return null Will return if `$output_callback` is empty after removing widget.
*/
function wp_register_sidebar_widget($id, $name, $output_callback, $options = array()) {
function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) {
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates, $_wp_deprecated_widgets_callbacks;
$id = strtolower($id);