From ad089ffe152ea4ff63f2654ef546fbb43106adb2 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 27 Sep 2015 01:16:24 +0000 Subject: [PATCH] Docs: Improve documentation for the `__construct()`, `widget()`, `update()`, and `form()` methods in `WP_Nav_Menu_Widget`. Props leemon. Fixes #34015. Fixes #34013. Built from https://develop.svn.wordpress.org/trunk@34621 git-svn-id: http://core.svn.wordpress.org/trunk@34585 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- .../widgets/class-wp-nav-menu-widget.php | 37 +++++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index cc97e865ad..f17191f091 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34620'; +$wp_version = '4.4-alpha-34621'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-nav-menu-widget.php b/wp-includes/widgets/class-wp-nav-menu-widget.php index e03905c6ed..16b08db43a 100644 --- a/wp-includes/widgets/class-wp-nav-menu-widget.php +++ b/wp-includes/widgets/class-wp-nav-menu-widget.php @@ -8,7 +8,7 @@ */ /** - * Core class used to implement the Navigation Menu widget. + * Core class used to implement the Custom Menu widget. * * @since 3.0.0 * @@ -16,14 +16,26 @@ */ class WP_Nav_Menu_Widget extends WP_Widget { + /** + * Sets up a new Custom Menu widget instance. + * + * @since 3.0.0 + * @access public + */ public function __construct() { $widget_ops = array( 'description' => __('Add a custom menu to your sidebar.') ); parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops ); } /** - * @param array $args - * @param array $instance + * Outputs the content for the current Custom Menu widget instance. + * + * @since 3.0.0 + * @access public + * + * @param array $args Display arguments including 'before_title', 'after_title', + * 'before_widget', and 'after_widget'. + * @param array $instance Settings for the current Custom Menu widget instance. */ public function widget( $args, $instance ) { // Get menu @@ -65,9 +77,15 @@ } /** - * @param array $new_instance - * @param array $old_instance - * @return array + * Handles updating settings for the current Custom Menu widget instance. + * + * @since 3.0.0 + * @access public + * + * @param array $new_instance New settings for this instance as input by the user via + * WP_Widget::form(). + * @param array $old_instance Old settings for this instance. + * @return array Updated settings to save. */ public function update( $new_instance, $old_instance ) { $instance = array(); @@ -81,7 +99,12 @@ } /** - * @param array $instance + * Outputs the settings form for the Custom Menu widget. + * + * @since 3.0.0 + * @access public + * + * @param array $instance Current settings. */ public function form( $instance ) { $title = isset( $instance['title'] ) ? $instance['title'] : '';