Make WordPress Core


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

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

Props leemon.
Fixes #34021. See #34013.

File:
1 edited

Legend:

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

    r34434 r34615  
    1717class WP_Widget_Pages extends WP_Widget {
    1818
     19    /**
     20     * Sets up a new Pages widget instance.
     21     *
     22     * @since 2.8.0
     23     * @access public
     24     */
    1925    public function __construct() {
    2026        $widget_ops = array('classname' => 'widget_pages', 'description' => __( 'A list of your site’s Pages.') );
     
    2329
    2430    /**
    25      * @param array $args
    26      * @param array $instance
     31     * Outputs the content for the current Pages 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 Pages widget instance.
    2739     */
    2840    public function widget( $args, $instance ) {
     
    7688
    7789    /**
    78      * @param array $new_instance
    79      * @param array $old_instance
    80      * @return array
     90     * Handles updating settings for the current Pages widget instance.
     91     *
     92     * @since 2.8.0
     93     * @access public
     94     *
     95     * @param array $new_instance New settings for this instance as input by the user via
     96     *                            WP_Widget::form().
     97     * @param array $old_instance Old settings for this instance.
     98     * @return array Updated settings to save.
    8199     */
    82100    public function update( $new_instance, $old_instance ) {
     
    95113
    96114    /**
    97      * @param array $instance
     115     * Outputs the settings form for the Pages widget.
     116     *
     117     * @since 2.8.0
     118     * @access public
     119     *
     120     * @param array $instance Current settings.
    98121     */
    99122    public function form( $instance ) {
    100123        //Defaults
    101124        $instance = wp_parse_args( (array) $instance, array( 'sortby' => 'post_title', 'title' => '', 'exclude' => '') );
    102     ?>
     125        ?>
    103126        <p>
    104127            <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:' ); ?></label>
     
    119142            <small><?php _e( 'Page IDs, separated by commas.' ); ?></small>
    120143        </p>
    121 <?php
     144        <?php
    122145    }
    123146
Note: See TracChangeset for help on using the changeset viewer.