WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#25130 closed defect (bug) (fixed)

Docblock documentation for WP_Query -> post property

Reported by: lgedeon Owned by: nacin
Milestone: 3.7 Priority: normal
Severity: normal Version: 3.0
Component: Inline Docs Keywords: needs-patch easy-fix
Focuses: Cc:
PR Number:

Description

Current docblock for the post property of WP_Query:

/**
 * The current post ID.
 *
 * @since 1.5.0
 * @access public
 * @var object
 */
var $post;

The $post property contains the current WP_Post object. We need to update the documentation to reflect this.

Attachments (1)

25130.patch (437 bytes) - added by lgedeon 6 years ago.
Additional notes for property description

Download all attachments as: .zip

Change History (7)

#1 @DrewAPicture
6 years ago

  • Keywords needs-patch easy-fix added
  • Milestone changed from Awaiting Review to 3.7

Care to add a patch?

#2 @lgedeon
6 years ago

  • Keywords needs-patch easy-fix removed
  • Version changed from 3.6 to 3.0

Documentation error partially fixed in 3.1. Appears to date back to at least 3.0 - #15105

Last edited 6 years ago by SergeyBiryukov (previous) (diff)

#3 @lgedeon
6 years ago

  • Keywords needs-patch easy-fix added

#4 @nacin
6 years ago

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

In 25110:

Correct phpdoc for WP_Query::$post. props lgedeon, fixes #25130.

@lgedeon
6 years ago

Additional notes for property description

#5 @lgedeon
6 years ago

Added a second patch a little late to the game. Hoping that is okay.

#6 @nacin
6 years ago

I think [25110] is good as-is. If there is no current post then yes it will contain nothing (which is also how it is defined in the class).

If every class property's type also accounted for the undefined case, you'd need to exclude all objects as you can't instantiate objects when defining a property.

Note: See TracTickets for help on using tickets.