Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#61759 closed enhancement (fixed)

Improve potentially confusing documentation for wp_strip_all_tags()

Reported by: coffee2code Owned by: SergeyBiryukov
Priority: lowest Milestone: 6.7
Component: Formatting Version: 3.9
Severity: trivial Keywords: has-patch
Cc: Focuses: docs

Description

As surfaced in meta#6510 by @krupalpanchal, the inline documentation for wp_strip_all_tags() ends with a sentence that does not have a period at its end. This can give the false impression that the rest of the sentence (and possibly more) has been truncated from its display in DevHub.

This is further complicated by the sentence ending in '', which at quick glance can be seen as a double-quote, giving the additional impression that quoted text is missing. For that reason, and just to be explicit in conveying what the return value will be, the '' should be replaced with an empty string.

In short, I'm suggesting changing

* will return 'something'. wp_strip_all_tags will return ''

to

* will return 'something'. wp_strip_all_tags will return an empty string.

A period was added at the end of the sentence, and '' was replaced with an empty string.

Change History (4)

This ticket was mentioned in PR #7092 on WordPress/wordpress-develop by @coffee2code.


2 years ago
#1

  • Keywords has-patch added

Explicitly express return value of the example is "an empty string" and add a period to indicate the end of the sentence.

#2 @SergeyBiryukov
2 years ago

  • Milestone Awaiting Review6.7
  • Owner set to SergeyBiryukov
  • Status newreviewing

#3 @SergeyBiryukov
2 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 58814:

Docs: Clarify the description for wp_strip_all_tags().

Follow-up to [11929], [27042].

Props coffee2code, krupalpanchal, mukesh27.
Fixes #61759.

@SergeyBiryukov commented on PR #7092:


2 years ago
#4

Thanks for the PR! Merged in r58814.

Note: See TracTickets for help on using tickets.