Make WordPress Core

Changeset 34617


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

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

Props leemon.
Fixes #34019. See #34013.

File:
1 edited

Legend:

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

    r34432 r34617  
    1717class WP_Widget_Links extends WP_Widget {
    1818
     19        /**
     20         * Sets up a new Links widget instance.
     21         *
     22         * @since 2.8.0
     23         * @access public
     24         */
    1925        public function __construct() {
    2026                $widget_ops = array('description' => __( "Your blogroll" ) );
    … …  
    2329
    2430        /**
    25          * @param array $args
    26          * @param array $instance
     31         * Outputs the content for the current Links widget instance.
     32         *
     33         * @since 2.8.0
     34         * @access public
     35         *
     36         * @param array $args     Display arguments including 'before_title', 'after_title',
     37         *                        'before_widget', and 'after_widget'.
     38         * @param array $instance Settings for the current Links widget instance.
    2739         */
    2840        public function widget( $args, $instance ) {
    … …  
    6981
    7082        /**
    71          * @param array $new_instance
    72          * @param array $old_instance
    73          * @return array
     83         * Handles updating settings for the current Links widget instance.
     84         *
     85         * @since 2.8.0
     86         * @access public
     87         *
     88         * @param array $new_instance New settings for this instance as input by the user via
     89         *                            WP_Widget::form().
     90         * @param array $old_instance Old settings for this instance.
     91         * @return array Updated settings to save.
    7492         */
    7593        public function update( $new_instance, $old_instance ) {
    … …  
    92110
    93111        /**
    94          * @param array $instance
     112         * Outputs the settings form for the Links widget.
     113         *
     114         * @since 2.8.0
     115         * @access public
     116         *
     117         * @param array $instance Current settings.
    95118         */
    96119        public function form( $instance ) {
    … …  
    101124                if ( ! $limit = intval( $instance['limit'] ) )
    102125                        $limit = -1;
    103 ?>
     126                        ?>
    104127                <p>
    105128                <label for="<?php echo $this->get_field_id('category'); ?>"><?php _e( 'Select Link Category:' ); ?></label>
    … …  
    136159                <input id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" type="text" value="<?php echo $limit == -1 ? '' : intval( $limit ); ?>" size="3" />
    137160                </p>
    138 <?php
     161                <?php
    139162        }
    140163}
Note: See TracChangeset for help on using the changeset viewer.