WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#18886 closed defect (bug) (fixed)

$stripteaser documentation incorrect

Reported by: GaryJ Owned by: duck_
Milestone: 3.3 Priority: normal
Severity: trivial Version: 3.2.1
Component: Inline Docs Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

For the_content() and get_the_content() functions, the @param tag for $stripteaser is listed as a string, yet the default value is an integer, and the actual usage is as a boolean.

The deprecated the_content_rss() lists it as an int|bool.

* @param string $stripteaser Optional. Teaser content before the more text.

should be updated in both cases to something like:

* @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false.

and set the default value from 0, to false, to make it clear that this is a boolean flag.

Within get_the_content() the line where $stripteaser is set to 1, should be changed to being set to true, just as the $hasTeaser boolean variable above it does. Clearer intention of a variable is worth a few extra bytes.

Attachments (1)

18886.diff (1.6 KB) - added by GaryJ 8 years ago.

Download all attachments as: .zip

Change History (4)

@GaryJ
8 years ago

#1 @GaryJ
8 years ago

Show teaser content in ticket description should be Strip teaser content as per the attachment.

#2 @SergeyBiryukov
8 years ago

  • Description modified (diff)
  • Milestone changed from Awaiting Review to 3.3

#3 @duck_
8 years ago

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

In [19069]:

Correctly document $stripteaser as a boolean flag. Props GaryJ, fixes #18886.

Note: See TracTickets for help on using tickets.