Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#45342 closed enhancement (fixed)

Docs: Description is wrong in the return of block_version()

Reported by: mukesh27's profile mukesh27 Owned by: youknowriad's profile youknowriad
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch fixed-5.0
Focuses: docs Cc:


Description is wrong in the return of block_version()

current description is:

* @return int The block format version.

must be:

* @return int 0 if the string doesn't contain blocks, 1 otherwise.

Attachments (2)

45342.patch (503 bytes) - added by mukesh27 5 years ago.
45342.2.patch (515 bytes) - added by mukesh27 5 years ago.
Updated patch.

Download all attachments as: .zip

Change History (13)

5 years ago


#1 @birgire
5 years ago

Related #43887 and

It seems that the idea was to have the possibility to increment the block version if breaking changes are introduced in the future.

It looks like a good improvement, as suggested by @mukesh27, to explain the possible return values, that are currently either 0 or 1.

Here's are suggested adjustments for 45342.patch, to e.g. avoid starting the description with a number:

* @return int The block format version is 1 if the content contains one or more blocks, 0 otherwise.

#2 @mukesh27
5 years ago

@birgire thanks for your suggestion.

#3 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.0

#4 @desrosj
5 years ago

  • Version trunk deleted

#5 @desrosj
5 years ago

@mukesh27 can you refresh the patch with the updated suggestion, please?

5 years ago

Updated patch.

#6 @mukesh27
5 years ago

@desrosj please check updated patch.

#7 @desrosj
5 years ago

  • Keywords commit added

Thanks for the update, @mukesh27. Looks like a good improvement to me.

#8 @youknowriad
5 years ago

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

In 43924:

Block Editor: Clarify PHP Docs of the block_version function.

Clarify the return value.

Props desrosj, mukesh27.
Fixes #45342.

#9 @youknowriad
5 years ago

  • Keywords fixed-5.0 added; commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Commited as I got an approval from @matveb

#10 @youknowriad
5 years ago

Oh I forgot to prop @birgire For this one. Not sure how we can fix that process wise?

#11 @desrosj
5 years ago

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

In 44270:

Block Editor: Fix PHP warning when loading editor styles while in RTL.

In RTL languages, WordPress adds style-editor-rtl.css editor styles to the global $editor_styles.
This patch ignores handling these styles if the file is not preset.

Also, clarify the docs for the return value of the block_version function.

Props mostafa.s1990, desrosj, mukesh27.

Merges [43923] and [43924] to trunk.

Fixes #45288, #45342.

Note: See TracTickets for help on using tickets.