Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#22537 closed enhancement (fixed)

Fix balanceTags() docs and make the logic better readable

Reported by: TobiasBg Owned by: SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: normal Version:
Component: Inline Docs Keywords: has-patch 3.6-early commit
Focuses: Cc:


The inline documentation of balanceTags() mixes up "and" and "or" in the first line. The function will does not require both $force and get_option(...) to be true, but just one. Apparently, some of the inline docs was already worked on in #19576, but the first line was left as-is.
Also, the logic of the function is kind of hard to read with unnecessary boolean inversions.

The attached patch fixed the docs and makes the function better readable.

Attachments (1)

22537-balanceTags.patch (886 bytes) - added by TobiasBg 8 years ago.
Fix balanceTags() docs and make the function better readable

Download all attachments as: .zip

Change History (6)

8 years ago

Fix balanceTags() docs and make the function better readable

#1 @TobiasBg
8 years ago

  • Component changed from General to Inline Docs
  • Keywords 3.6-early added

#2 @SergeyBiryukov
8 years ago

  • Milestone changed from Awaiting Review to 3.6

#3 @SergeyBiryukov
8 years ago

  • Keywords commit added

Boolean inversions are the result of the changes [3751] and [5805].

The initial description (that appears to be inaccurate) was added in [8783].

22537-balanceTags.patch looks good.

#4 @SergeyBiryukov
8 years ago

Also passes the unit tests in formatting/balanceTags.php and post/filtering.php.

#5 @SergeyBiryukov
8 years ago

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

In 23368:

Correct the documentation for balanceTags(). Remove unnecessary boolean inversion. props TobiasBg. fixes #22537.

Note: See TracTickets for help on using tickets.