Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#34017 closed defect (bug) (fixed)

Improve method documentation for WP_Widget_Calendar

Reported by: drewapicture's profile DrewAPicture Owned by: leemon's profile leemon
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

Note: This is part of the effort in #34013 to improve method documentation to all core widget classes

Class: WP_Widget_Calendar
File: wp-includes/widgets/class-wp-widget-calendar.php

Attachments (3)

34017.patch (2.2 KB) - added by leemon 9 years ago.
Improve method documentation
34017.2.patch (2.2 KB) - added by leemon 9 years ago.
Correct patch. Ignore the previous one.
34017.3.patch (2.3 KB) - added by leemon 9 years ago.
Updated method descriptions

Download all attachments as: .zip

Change History (10)

@leemon
9 years ago

Improve method documentation

@leemon
9 years ago

Correct patch. Ignore the previous one.

#1 @SergeyBiryukov
9 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.4
  • Owner set to DrewAPicture
  • Status changed from new to assigned

Hi @leemon, thanks for the patch! Just a note, attachments don't trigger email notifications, so it's a good idea to leave a comment whenever you upload something.

#2 @leemon
9 years ago

Thanks for the info. I didn't know that.

#3 @leemon
9 years ago

Added patch to improve the method docs for the widget(), update(), form(), and __construct() methods in the WP_Widget_Calendar class.

34017.2.patch

#4 @DrewAPicture
9 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 4.4 to Awaiting Review
  • Owner changed from DrewAPicture to leemon

Hi @leemon,

Thanks for the patch!

As mentioned in #34027:

Just a couple of notes:

  • Let's go with the vernacular of something like "the current {type} widget instance" instead of "a particular instance of a widget". Being general in the WP_Widget base class is fine, but in this context, we can be more specific. For example:
 * Handles updating settings for the current Text widget instance.
  • Notice I inserted the type of widget, in this case "Text", and more specifically mentioned updating the settings which is what the update() method does.
  • The same sort of advice goes along with any other method in the class. The idea is to avoid simple copy pasta and actually get specific :-)

@leemon
9 years ago

Updated method descriptions

#5 @leemon
9 years ago

  • Keywords has-patch added; needs-patch removed

#6 @DrewAPicture
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34619:

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

Props leemon.
Fixes #34017. See #34013.

#7 @DrewAPicture
9 years ago

  • Milestone changed from Awaiting Review to 4.4
Note: See TracTickets for help on using tickets.