WordPress.org

Make WordPress Core

Ticket #28298: 28298.the_widget.diff

File 28298.the_widget.diff, 1.5 KB (added by coffee2code, 6 years ago)

Add documentation for default arguments in the_widget(). (Plus minor formatting tweaks to the function's other @params.)

  • src/wp-includes/widgets.php

     
    14421442 *
    14431443 * @since 2.8.0
    14441444 *
    1445  * @param string $widget the widget's PHP class name (see default-widgets.php)
    1446  * @param array $instance the widget's instance settings
    1447  * @param array $args the widget's sidebar args
    1448  * @return void
    1449  **/
     1445 * @param string $widget   The widget's PHP class name (see default-widgets.php).
     1446 * @param array  $instance Optional. The widget's instance settings.
     1447 * @param array  $args {
     1448 *     Optional. Array of arguments to configure the display of the widget.
     1449 *
     1450 *     @type string $before_widget HTML content that will be prepended to the widget's HTML output.
     1451 *                                 Default '<div class="widget %s">', where '%s' is the widget's class name.
     1452 *     @type string $after_widget  HTML content that will be appended to the widget's HTML output.
     1453 *                                 Default '</div>'.
     1454 *     @type string $before_title  HTML content that will be prepended to the widget's title when displayed.
     1455 *                                 Default '<h2 class="widgettitle">'.
     1456 *     @type string $after_title   HTML content that will be appended to the widget's title when displayed.
     1457 *                                 Default '</h2>'.
     1458 * }
     1459 */
    14501460function the_widget($widget, $instance = array(), $args = array()) {
    14511461        global $wp_widget_factory;
    14521462