From 982d5b99eac117a4dd296b4938f25d894c08383f Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 27 Sep 2015 01:10:38 +0000 Subject: [PATCH] Docs: Improve documentation for the `__construct()`, `widget()`, `update()`, and `form()` methods in `WP_Widget_Archives`. Props leemon. Fixes #34016. See #34013. git-svn-id: https://develop.svn.wordpress.org/trunk@34620 602fd350-edb4-49c9-b593-d223f7449a82 --- .../widgets/class-wp-widget-archives.php | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/src/wp-includes/widgets/class-wp-widget-archives.php b/src/wp-includes/widgets/class-wp-widget-archives.php index 9d0f3ac8ef..30e4ee0db2 100644 --- a/src/wp-includes/widgets/class-wp-widget-archives.php +++ b/src/wp-includes/widgets/class-wp-widget-archives.php @@ -16,14 +16,26 @@ */ class WP_Widget_Archives extends WP_Widget { + /** + * Sets up a new Archives widget instance. + * + * @since 2.8.0 + * @access public + */ public function __construct() { $widget_ops = array('classname' => 'widget_archive', 'description' => __( 'A monthly archive of your site’s Posts.') ); parent::__construct('archives', __('Archives'), $widget_ops); } /** - * @param array $args - * @param array $instance + * Outputs the content for the current Archives widget instance. + * + * @since 2.8.0 + * @access public + * + * @param array $args Display arguments including 'before_title', 'after_title', + * 'before_widget', and 'after_widget'. + * @param array $instance Settings for the current Archives widget instance. */ public function widget( $args, $instance ) { $c = ! empty( $instance['count'] ) ? '1' : '0'; @@ -39,7 +51,7 @@ class WP_Widget_Archives extends WP_Widget { if ( $d ) { $dropdown_id = "{$this->id_base}-dropdown-{$this->number}"; -?> + ?> - + - '', 'count' => 0, 'dropdown' => '') ); $title = sanitize_text_field( $instance['title'] ); -?> + ?>

id="get_field_id('dropdown'); ?>" name="get_field_name('dropdown'); ?>" />
id="get_field_id('count'); ?>" name="get_field_name('count'); ?>" />

-