WordPress.org

Make WordPress Core

#51401 closed enhancement (fixed)

Docs: Fix bracket issue in autosave JS DocBlock

Reported by: dilipbheda Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.6
Component: Autosave Keywords: has-patch commit
Focuses: javascript, docs Cc:

Description

Fix inline documentation.

Attachments (2)

51401.patch (815 bytes) - added by dilipbheda 12 months ago.
51401.1.patch (893 bytes) - added by dilipbheda 12 months ago.
Updated patch

Download all attachments as: .zip

Change History (8)

@dilipbheda
12 months ago

#1 @mukesh27
12 months ago

  • Keywords needs-refresh added

Hi there!

The 51401.patch patch needs update because you have added an extra }.

<?php
/**
 * Auto saves the post.
 *
 * @since 3.9.0
 *
 * @return {Object} {
 *      {
 *      getPostData: getPostData,
 *      getCompareString: getCompareString,
 *      disableButtons: disableButtons,
 *      enableButtons: enableButtons,
 *      local: ({hasStorage, getSavedPostData, save, suspend, resume}|*),
 *      server: ({tempBlockSave, triggerSave, postChanged, suspend, resume}|*)
 *      }
 * } The object with all functions for autosave.
 */

@dilipbheda
12 months ago

Updated patch

#2 @dilipbheda
12 months ago

  • Keywords needs-refresh removed

#3 @dilipbheda
12 months ago

@mukesh27 I have removed extra }

Thank you

#4 @mukesh27
12 months ago

  • Keywords commit added
  • Type changed from defect (bug) to enhancement

51401.1.patch thanks for update.

Patch looks good. Marking for commit.

#5 @SergeyBiryukov
12 months ago

  • Milestone changed from Awaiting Review to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

Thanks for the patch!

I haven't found any other instances in core where we document object properties like this, but the closest match appears to be the "Record Type" from Google JavaScript Style Guide:

{{myNum: number, myObject}}

So it looks like double brackets are OK, let's just correct the second bracket placement.

#6 @SergeyBiryukov
12 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49065:

Docs: Correct formatting for the autosave() function return value in js/_enqueues/wp/autosave.js.

Props dilipbheda, mukesh27.
Fixes #51401.

Note: See TracTickets for help on using tickets.