Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#48640 closed task (blessed) (fixed)

Update docblocks of register block type related function and classes

Reported by: ediamin's profile ediamin Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version: 5.0
Component: Editor Keywords: has-patch
Focuses: docs Cc:

Description

This patch updates docblocks of register_block_type, WP_Block_Type_Registry::register and WP_Block_Type::__construct methods concerning the optional arg parameter.

Attachments (4)

48640.diff (3.0 KB) - added by ediamin 5 years ago.
48640-2.diff (9.4 KB) - added by ediamin 5 years ago.
Update param doc block for WP v5.5.0
48640.3.diff (9.4 KB) - added by audrasjb 4 years ago.
Patch refresh against trunk
48640.4.diff (9.5 KB) - added by ediamin 4 years ago.
Update $render_callback type

Download all attachments as: .zip

Change History (20)

@ediamin
5 years ago

#1 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.4

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


5 years ago

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


5 years ago

#4 @davidbaumwald
5 years ago

  • Milestone changed from 5.4 to Future Release

This ticket still needs a review, and with 5.4 Beta 1 landing today, this is being moved to Future Release. If any maintainer or committer feels this can be included in 5.4 or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

#5 @SergeyBiryukov
5 years ago

  • Milestone changed from Future Release to 5.5
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


5 years ago

#7 @SergeyBiryukov
5 years ago

  • Type changed from enhancement to task (blessed)

#8 @SergeyBiryukov
5 years ago

In 48629:

Docs: Add a note that the $args parameter of register_block_type() accepts any public property of WP_Block_Type.

Follow-up to [47754].

Props ediamin.
See #48640.

#9 @SergeyBiryukov
5 years ago

  • Keywords needs-refresh added
  • Milestone changed from 5.5 to 5.6

Thanks for the patch! A few more properties were added in [47875] / #48529, so it needs a refresh.

Moving to 5.6 for now.

@ediamin
5 years ago

Update param doc block for WP v5.5.0

#10 @ediamin
5 years ago

@SergeyBiryukov Since the newly added param doesn't have any description of their own in class WP_Block_Type, I added them using the description I've found in https://github.com/WordPress/gutenberg/blob/master/packages/blocks/src/api/registration.js and https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-registration.md

If you think they are not appropriate, please suggest how I can improve.

#11 @audrasjb
4 years ago

The patch doesn't apply cleanly anymore. Refreshed patch coming :)

@audrasjb
4 years ago

Patch refresh against trunk

#12 @audrasjb
4 years ago

  • Keywords needs-refresh removed

#13 @SergeyBiryukov
4 years ago

  • Milestone changed from 5.6 to 5.7

Didn't get a chance to review this in time for 5.6 RC, moving to the next release for now.

#14 @peterwilsoncc
4 years ago

render_callback() is optional and defaults to null, throughout it is documented only as callable. Should that be callable|null?

For the WP_Block property descriptions it would be nice to include short summaries/titles for category, parent and keywords. There's a minor alignment issues on the constructors parameters, with further changes needed, I won't upload a fix.

@ediamin
4 years ago

Update $render_callback type

#15 @ediamin
4 years ago

@peterwilsoncc You are right, $render_callback should be callable|null. I've added an updated patch with this change based on the 48640.3.diff by @audrasjb.

#16 @SergeyBiryukov
4 years ago

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

In 50419:

Docs: Improve documentation for WP_Block_Type properties.

Add a reference to WP_Block_Type::__construct() for information on accepted arguments in register_block_type().

Synchronize the documentation between several places, use WP_Block_Type::__construct() as the canonical source.

Props ediamin, audrasjb, peterwilsoncc.
Fixes #48640.

Note: See TracTickets for help on using tickets.