From b28f41f8526d19be0af09a6f0cc9ad19a5740fe5 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 27 Sep 2015 00:31:59 +0000 Subject: [PATCH] Docs: Improve the documentation for the `__construct()`, `widget()`, `update()`, and `form()` methods in `WP_Widget_Tag_Cloud`. Props leemon. Fixes #34026. See #34013. git-svn-id: https://develop.svn.wordpress.org/trunk@34610 602fd350-edb4-49c9-b593-d223f7449a82 --- .../widgets/class-wp-widget-tag-cloud.php | 44 +++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/wp-includes/widgets/class-wp-widget-tag-cloud.php b/src/wp-includes/widgets/class-wp-widget-tag-cloud.php index 7d2a6a7629..9837f1da0b 100644 --- a/src/wp-includes/widgets/class-wp-widget-tag-cloud.php +++ b/src/wp-includes/widgets/class-wp-widget-tag-cloud.php @@ -16,14 +16,26 @@ */ class WP_Widget_Tag_Cloud extends WP_Widget { + /** + * Sets up a new Tag Cloud widget instance. + * + * @since 2.8.0 + * @access public + */ public function __construct() { $widget_ops = array( 'description' => __( "A cloud of your most used tags.") ); parent::__construct('tag_cloud', __('Tag Cloud'), $widget_ops); } /** - * @param array $args - * @param array $instance + * Outputs the content for the current Tag Cloud 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 Tag Cloud widget instance. */ public function widget( $args, $instance ) { $current_taxonomy = $this->_get_current_taxonomy($instance); @@ -74,9 +86,15 @@ class WP_Widget_Tag_Cloud extends WP_Widget { } /** - * @param array $new_instance - * @param array $old_instance - * @return array + * Handles updating settings for the current Tag Cloud widget instance. + * + * @since 2.8.0 + * @access public + * + * @param array $new_instance New settings for this instance as input by the user via + * WP_Widget::form(). + * @param array $old_instance Old settings for this instance. + * @return array Settings to save or bool false to cancel saving. */ public function update( $new_instance, $old_instance ) { $instance = array(); @@ -86,7 +104,12 @@ class WP_Widget_Tag_Cloud extends WP_Widget { } /** - * @param array $instance + * Outputs the Tag Cloud widget settings form. + * + * @since 2.8.0 + * @access public + * + * @param array $instance Current settings. */ public function form( $instance ) { $current_taxonomy = $this->_get_current_taxonomy($instance); @@ -141,8 +164,13 @@ class WP_Widget_Tag_Cloud extends WP_Widget { } /** - * @param array $instance - * @return string + * Retrieves the taxonomy for the current Tag cloud widget instance. + * + * @since 4.4.0 + * @access public + * + * @param array $instance Current settings. + * @return string Name of the current taxonomy if set, otherwise 'post_tag'. */ public function _get_current_taxonomy($instance) { if ( !empty($instance['taxonomy']) && taxonomy_exists($instance['taxonomy']) )