Make WordPress Core

Changeset 34609


Ignore:
Timestamp:
09/27/2015 12:26:56 AM (11 years ago)
Author:
DrewAPicture
Message:

Docs: Improve documentation for the __construct(), widget(), update(), and form() methods in WP_Widget_Text.

(first!) Props leemon.
Fixes #34027.

File:
1 edited

Legend:

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

    r34553 r34609  
    1717class WP_Widget_Text extends WP_Widget {
    1818
     19        /**
     20         * Sets up a new Text widget instance.
     21         *
     22         * @since 2.8.0
     23         * @access public
     24         */
    1925        public function __construct() {
    2026                $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML.'));
    … …  
    2430
    2531        /**
    26          * Outputs the Text widget content.
     32         * Outputs the content for the current Text widget instance.
    2733         *
    2834         * @since 2.8.0
    … …  
    3137         * @param array $args     Display arguments including 'before_title', 'after_title',
    3238         *                        'before_widget', and 'after_widget'.
    33          * @param array $instance The settings for the particular instance of the widget.
     39         * @param array $instance Settings for the current Text widget instance.
    3440         */
    3541        public function widget( $args, $instance ) {
    … …  
    6268
    6369        /**
    64          * @param array $new_instance
    65          * @param array $old_instance
    66          * @return array
     70         * Handles updating settings for the current Text widget instance.
     71         *
     72         * @since 2.8.0
     73         * @access public
     74         *
     75         * @param array $new_instance New settings for this instance as input by the user via
     76         *                            WP_Widget::form().
     77         * @param array $old_instance Old settings for this instance.
     78         * @return array Settings to save or bool false to cancel saving.
    6779         */
    6880        public function update( $new_instance, $old_instance ) {
    … …  
    7890
    7991        /**
    80          * @param array $instance
     92         * Outputs the Text widget settings form.
     93         *
     94         * @since 2.8.0
     95         * @access public
     96         *
     97         * @param array $instance Current settings.
    8198         */
    8299        public function form( $instance ) {
    … …  
    92109
    93110                <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox"<?php checked( $filter ); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs'); ?></label></p>
    94 <?php
     111                <?php
    95112        }
    96113}
Note: See TracChangeset for help on using the changeset viewer.