Make WordPress Core


Ignore:
Timestamp:
12/01/2014 07:34:25 PM (10 years ago)
Author:
DrewAPicture
Message:

Improve inline documentation for four methods in WP_Widget: get_field_id(), display_callback(), update_callback(), and form_callback().

Props jazzs3quence for the initial patch.
See #30315.

File:
1 edited

Legend:

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

    r30665 r30691  
    133133
    134134    /**
    135      * Constructs id attributes for use in form() fields
    136      *
    137      * This function should be used in form() methods to create id attributes for fields to be saved by update()
    138      *
    139      * @param string $field_name Field name
    140      * @return string ID attribute for $field_name
    141      */
    142     public function get_field_id($field_name) {
     135     * Constructs id attributes for use in {@see WP_Widget::form()} fields.
     136     *
     137     * This function should be used in form() methods to create id attributes
     138     * for fields to be saved by {@see WP_Widget::update()}.
     139     *
     140     * @since 2.8.0
     141     * @access public
     142     *
     143     * @param string $field_name Field name.
     144     * @return string ID attribute for `$field_name`.
     145     */
     146    public function get_field_id( $field_name ) {
    143147        return 'widget-' . $this->id_base . '-' . $this->number . '-' . $field_name;
    144148    }
     
    221225     * Finds the instance and calls {@see WP_Widget::widget()}.
    222226     *
     227     * @since 2.8.0
    223228     * @access public
    224229     *
     
    274279
    275280    /**
    276      * Deal with changed settings.
    277      *
    278      * Do NOT over-ride this function.
     281     * Deal with changed settings (Do NOT override).
     282     *
     283     * @since 2.8.0
     284     * @access public
    279285     *
    280286     * @param int $deprecated Not used.
     
    356362
    357363    /**
    358      * Generate the control form.
    359      *
    360      * Do NOT over-ride this function.
     364     * Generate the widget control form (Do NOT override).
     365     *
     366     * @since 2.8.0
     367     * @access public
     368     *
     369     * @param int|array $widget_args Widget instance number or array of widget arguments.
    361370     */
    362371    public function form_callback( $widget_args = 1 ) {
Note: See TracChangeset for help on using the changeset viewer.