WordPress.org

Make WordPress Core

#45342 closed enhancement (fixed)

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

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

Description

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 13 months ago.
Patch
45342.2.patch (515 bytes) - added by mukesh27 13 months ago.
Updated patch.

Download all attachments as: .zip

Change History (13)

@mukesh27
13 months ago

Patch

#1 @birgire
13 months ago

Related #43887 and https://github.com/WordPress/gutenberg/issues/6435

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
13 months ago

@birgire thanks for your suggestion.

#3 @SergeyBiryukov
13 months ago

  • Milestone changed from Awaiting Review to 5.0

#4 @desrosj
13 months ago

  • Version trunk deleted

#5 @desrosj
13 months ago

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

@mukesh27
13 months ago

Updated patch.

#6 @mukesh27
13 months ago

@desrosj please check updated patch.

#7 @desrosj
13 months ago

  • Keywords commit added

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

#8 @youknowriad
13 months 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
13 months 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
13 months ago

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

#11 @desrosj
12 months 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.