From 83da7624e60ecac81b9bf5123115c358e5e70ad4 Mon Sep 17 00:00:00 2001
From: Drew Jaynes
Date: Sun, 27 Sep 2015 00:27:26 +0000
Subject: [PATCH] Docs: Improve documentation for the `__construct()`,
`widget()`, `update()`, and `form()` methods in `WP_Widget_Text`.
(first!) Props leemon.
Fixes #34027.
Built from https://develop.svn.wordpress.org/trunk@34609
git-svn-id: http://core.svn.wordpress.org/trunk@34573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-includes/version.php | 2 +-
wp-includes/widgets/class-wp-widget-text.php | 31 +++++++++++++++-----
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 6bf541cf8d..0eef6c5ced 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
-$wp_version = '4.4-alpha-34608';
+$wp_version = '4.4-alpha-34609';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/wp-includes/widgets/class-wp-widget-text.php b/wp-includes/widgets/class-wp-widget-text.php
index 5e11b80e31..96cf642908 100644
--- a/wp-includes/widgets/class-wp-widget-text.php
+++ b/wp-includes/widgets/class-wp-widget-text.php
@@ -16,6 +16,12 @@
*/
class WP_Widget_Text extends WP_Widget {
+ /**
+ * Sets up a new Text widget instance.
+ *
+ * @since 2.8.0
+ * @access public
+ */
public function __construct() {
$widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML.'));
$control_ops = array('width' => 400, 'height' => 350);
@@ -23,14 +29,14 @@ class WP_Widget_Text extends WP_Widget {
}
/**
- * Outputs the Text widget content.
+ * Outputs the content for the current Text 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 The settings for the particular instance of the widget.
+ * @param array $instance Settings for the current Text widget instance.
*/
public function widget( $args, $instance ) {
@@ -61,9 +67,15 @@ class WP_Widget_Text extends WP_Widget {
}
/**
- * @param array $new_instance
- * @param array $old_instance
- * @return array
+ * Handles updating settings for the current Text 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 = $old_instance;
@@ -77,7 +89,12 @@ class WP_Widget_Text extends WP_Widget {
}
/**
- * @param array $instance
+ * Outputs the Text widget settings form.
+ *
+ * @since 2.8.0
+ * @access public
+ *
+ * @param array $instance Current settings.
*/
public function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
@@ -91,6 +108,6 @@ class WP_Widget_Text extends WP_Widget {
/>
-