Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#45342 closed enhancement (fixed)

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

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

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

Download all attachments as: .zip

Change History (13)

#1 @birgire
8 years 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
8 years ago

@birgire thanks for your suggestion.

#3 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review → 5.0

#4 @desrosj
8 years ago

  • Version trunk

#5 @desrosj
8 years ago

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

@mukesh27
8 years ago

Updated patch.

#6 @mukesh27
8 years ago

@desrosj please check updated patch.

#7 @desrosj
8 years ago

  • Keywords commit added

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

#8 @youknowriad
8 years ago

  • Owner set to youknowriad
  • Resolution → fixed
  • Status new → closed

In 43924:

Block Editor: Clarify PHP Docs of the block_version function.

Clarify the return value.

Props desrosj, mukesh27.
Fixes #45342.

#9 @youknowriad
8 years ago

  • Keywords fixed-5.0 added; commit removed
  • Resolution fixed
  • Status closed → reopened

Commited as I got an approval from @matveb

#10 @youknowriad
8 years ago

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

#11 @desrosj
8 years ago

  • Resolution → fixed
  • Status reopened → 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.