Make WordPress Core

Changeset 34611


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

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

Props leemon.
Fixes #34025. See #34013.

File:
1 edited

Legend:

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

    r34438 r34611  
    1717class WP_Widget_Search extends WP_Widget {
    1818
     19    /**
     20     * Sets up a new Search widget instance.
     21     *
     22     * @since 2.8.0
     23     * @access public
     24     */
    1925    public function __construct() {
    2026        $widget_ops = array('classname' => 'widget_search', 'description' => __( "A search form for your site.") );
     
    2329
    2430    /**
    25      * @param array $args
    26      * @param array $instance
     31     * Outputs the content for the current Search 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 Search widget instance.
    2739     */
    2840    public function widget( $args, $instance ) {
     
    4254
    4355    /**
    44      * @param array $instance
     56     * Outputs the settings form for the Search widget.
     57     *
     58     * @since 2.8.0
     59     * @access public
     60     *
     61     * @param array $instance Current settings.
    4562     */
    4663    public function form( $instance ) {
    4764        $instance = wp_parse_args( (array) $instance, array( 'title' => '') );
    4865        $title = $instance['title'];
    49 ?>
     66        ?>
    5067        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <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); ?>" /></label></p>
    51 <?php
     68        <?php
    5269    }
    5370
    5471    /**
    55      * @param array $new_instance
    56      * @param array $old_instance
    57      * @return array
     72     * Handles updating settings for the current Search widget instance.
     73     *
     74     * @since 2.8.0
     75     * @access public
     76     *
     77     * @param array $new_instance New settings for this instance as input by the user via
     78     *                            WP_Widget::form().
     79     * @param array $old_instance Old settings for this instance.
     80     * @return array Updated settings.
    5881     */
    5982    public function update( $new_instance, $old_instance ) {
Note: See TracChangeset for help on using the changeset viewer.