WordPress.org

Make WordPress Core

Changeset 30776


Ignore:
Timestamp:
12/07/2014 08:10:37 PM (4 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets.php

    r30774 r30776  
    850850
    851851/**
    852  * Register widget for use in sidebars.
     852 * Register an instance of a widget.
    853853 *
    854854 * The default widget option is 'classname' that can be overridden.
    855855 *
    856  * The function can also be used to un-register widgets when $output_callback
     856 * The function can also be used to un-register widgets when `$output_callback`
    857857 * parameter is an empty string.
    858858 *
    859859 * @since 2.2.0
    860860 *
    861  * @uses $wp_registered_widgets Uses stored registered widgets.
    862  * @uses $wp_register_widget_defaults Retrieves widget defaults.
    863  *
    864  * @param int|string $id Widget ID.
    865  * @param string $name Widget display title.
    866  * @param callback $output_callback Run when widget is called.
    867  * @param array|string $options Optional. Widget Options.
    868  * @param mixed $params,... Widget parameters to add to widget.
    869  * @return null Will return if $output_callback is empty after removing widget.
    870  */
    871 function wp_register_sidebar_widget($id, $name, $output_callback, $options = array()) {
     861 * @global array $wp_registered_widgets       Uses stored registered widgets.
     862 * @global array $wp_register_widget_defaults Retrieves widget defaults.
     863 *
     864 * @param int|string $id              Widget ID.
     865 * @param string     $name            Widget display title.
     866 * @param callback   $output_callback Run when widget is called.
     867 * @param array      $options {
     868 *     Optional. An array of supplementary widget options for the instance.
     869 *
     870 *     @type string $classname   Class name for the widget's HTML container. Default is a shortened
     871 *                               version of the output callback name.
     872 *     @type string $description Widget description for display in the widget administration
     873 *                               panel and/or theme.
     874 * }
     875 * @return null Will return if `$output_callback` is empty after removing widget.
     876 */
     877function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) {
    872878    global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates, $_wp_deprecated_widgets_callbacks;
    873879
Note: See TracChangeset for help on using the changeset viewer.