Make WordPress Core


Ignore:
Timestamp:
09/27/2015 01:06:20 AM (9 years ago)
Author:
DrewAPicture
Message:

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

Props leemon.
Fixes #34017. See #34013.

File:
1 edited

Legend:

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

    r34430 r34619  
    2727    private static $instance = 0;
    2828
     29    /**
     30     * Sets up a new Calendar widget instance.
     31     *
     32     * @since 2.8.0
     33     * @access public
     34     */
    2935    public function __construct() {
    3036        $widget_ops = array('classname' => 'widget_calendar', 'description' => __( 'A calendar of your site’s Posts.') );
     
    3339
    3440    /**
    35      * @param array $args
    36      * @param array $instance
     41     * Outputs the content for the current Calendar widget instance.
     42     *
     43     * @since 2.8.0
     44     * @access public
     45     *
     46     * @param array $args     Display arguments including 'before_title', 'after_title',
     47     *                        'before_widget', and 'after_widget'.
     48     * @param array $instance The settings for the particular instance of the widget.
    3749     */
    3850    public function widget( $args, $instance ) {
     
    5769
    5870    /**
    59      * @param array $new_instance
    60      * @param array $old_instance
    61      * @return array
     71     * Handles updating settings for the current Calendar widget instance.
     72     *
     73     * @since 2.8.0
     74     * @access public
     75     *
     76     * @param array $new_instance New settings for this instance as input by the user via
     77     *                            WP_Widget::form().
     78     * @param array $old_instance Old settings for this instance.
     79     * @return array Updated settings to save.
    6280     */
    6381    public function update( $new_instance, $old_instance ) {
     
    6987
    7088    /**
    71      * @param array $instance
     89     * Outputs the settings form for the Calendar widget.
     90     *
     91     * @since 2.8.0
     92     * @access public
     93     *
     94     * @param array $instance Current settings.
    7295     */
    7396    public function form( $instance ) {
    7497        $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
    7598        $title = sanitize_text_field( $instance['title'] );
    76 ?>
     99        ?>
    77100        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
    78101        <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
    79 <?php
     102        <?php
    80103    }
    81104}
Note: See TracChangeset for help on using the changeset viewer.