Make WordPress Core

Opened 7 months ago

Closed 6 months ago

Last modified 4 months ago

#65112 closed defect (bug) (fixed)

Docs: Correct typos in JS inline comments and docblocks

Reported by: parinpanjari Owned by: westonruter
Priority: lowest Milestone: 7.1
Component: General Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses: docs

Description

Five typos exist in WordPress-authored JavaScript comments and docblocks
under src/js/_enqueues/:

  1. src/js/_enqueues/wp/api.js:986 — "add nince and pagination support" should be "nonce". (The next docblock line correctly uses "nonce", confirming the intent.)
  1. src/js/_enqueues/wp/api.js:1291 — "Clear the parent part of the rouite if its actually the version string" should be "route" (and "its" → "it's"). Both are fixed in the attached patch.
  1. src/js/_enqueues/wp/customize/controls.js:593 — "Dates not beung allowed for revisions..." should be "being".
  1. src/js/_enqueues/wp/customize/nav-menus.js:3542 — docblock says returning a "unnammed" fallback string — should be "unnamed". The actual code at line 3553 correctly references l10n.unnamed, so the docblock is currently quoting the wrong spelling.
  1. src/js/_enqueues/lib/admin-bar.js:420 — "Get the closest matching elent" should be "element".

The attached patch updates only the authoritative _enqueues sources.
The corresponding build artifacts under src/wp-admin/js/ and
src/wp-includes/js/ are regenerated by grunt and are .gitignored.

Adjacent issue (not included in this patch): line 593 of controls.js
also contains an "are is" grammar error ("...for revisions are is a
technical limitation..."). Happy to fold into this patch or address in
a follow-up per committer preference.

Attachments (2)

ticket-1-js-docblock-typos.diff​ (2.5 KB ) - added by parinpanjari 7 months ago.
65112.2.full.diff​ (2.5 KB ) - added by parinpanjari 7 months ago.

Download all attachments as: .zip

Change History (10)

#1 @dmsnell
7 months ago

@parinpanjari there’s another issue on one of your changed lines. maybe want to fix that too?

Dates not being allowed for revisions are is a technical limitation of post revisions.

There’s an issue with “are is”

#2 @parinpanjari
7 months ago

@dmsnell

Good catch, thanks! Yes, please drop the stray "are" as part of this commit. Happy for you to fold that in directly — no need for a revised patch.

#3 @parinpanjari
7 months ago

  • Keywords has-patch added

#4 @westonruter
7 months ago

  • Component REST API → General
  • Focuses docs added
  • Milestone Awaiting Review → 7.1

@parinpanjari Please add another patch with that additional fix.

Once that's in place, this can be marked as ready for commit.

But we'll not commit this right away since trunk is currently frozen for 7.0.

#5 @parinpanjari
7 months ago

@westonruter

Thanks! Attached an updated patch with the extra are removed. Fully understood on the 7.0 freeze, No rush.

#6 @westonruter
7 months ago

  • Keywords commit added
  • Owner set to westonruter
  • Priority normal → lowest
  • Status new → reviewing

#7 @SergeyBiryukov
6 months ago

  • Resolution → fixed
  • Status reviewing → closed

In 62431:

Docs: Correct some typos in JS inline comments and DocBlocks.

Props parinpanjari, dmsnell, westonruter, SergeyBiryukov.
Fixes #65112.

#8 @westonruter
4 months ago

In 62692:

Docs: Correct grammar and spelling in api.js documentation.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/12477.
Follow-up to r38832, r62431.

Props sabernhardt, baikaresandeep007, wildworks, gaurangsondagar.
See #65112.
Fixes #65119.

Note: See TracTickets for help on using tickets.