Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#28203 closed defect (bug) (fixed)

Improve inline docs description for WP_Error::__construct()

Reported by: jdgrimes's profile jdgrimes Owned by: drewapicture's profile DrewAPicture
Milestone: 4.0 Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: has-patch
Focuses: docs Cc:

Description

The docblock description of WP_Error::__construct() is confusing.

         * If code parameter is empty then nothing will be done. It is possible to
         * add multiple messages to the same code, but with other methods in the
         * class.
         *
         * All parameters are optional, but if the code parameter is set, then the
         * data parameter is optional.

Introduced in [8900].

Attachments (2)

28203.patch (968 bytes) - added by jdgrimes 9 years ago.
First pass, could probably be much improved
28203.2.patch (1.3 KB) - added by jdgrimes 9 years ago.
Be less ambiguous, improve add() docs as well

Download all attachments as: .zip

Change History (6)

@jdgrimes
9 years ago

First pass, could probably be much improved

#1 @DrewAPicture
9 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.0

I agree the original description is confusing. It would be nice to make the second part less ambiguous. "other methods" is pretty vague:

It is possible to add multiple messages to the same code by using other methods in the class.

Can we be more specific here?

@jdgrimes
9 years ago

Be less ambiguous, improve add() docs as well

#2 @jdgrimes
9 years ago

28203.2.patch removes the ambiguity, and improves the summary for the add() method as well.

Last edited 9 years ago by DrewAPicture (previous) (diff)

#3 @DrewAPicture
9 years ago

  • Keywords has-patch added; needs-patch removed

28203.2.patch is much better, thanks.

#4 @DrewAPicture
9 years ago

  • Owner set to DrewAPicture
  • Resolution set to fixed
  • Status changed from new to closed

In 28660:

Improve inline documentation for the __construct() and add() methods in WP_Error class.

Props jdgrimes.
Fixes #28203.

Note: See TracTickets for help on using tickets.