#59453 closed enhancement (fixed)
Replace property_exists call in block api with instanceof
| Reported by: | spacedmonkey | Owned by: | gziolo |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.4 |
| Component: | Editor | Version: | 5.8 |
| Severity: | normal | Keywords: | has-patch gutenberg-merge |
| Cc: | Focuses: | coding-standards |
Description
Remove calls this in block functions
property_exists( $block_type, 'supports' )
with
$block_type instanceof WP_Block_Type
Change History (12)
This ticket was mentioned in PR #5308 on WordPress/wordpress-develop by @spacedmonkey.
3 years ago
#1
- Keywords has-patch added
#4
@
3 years ago
@spacedmonkey Could you share some benchmarks or profiles here in regards to the performance impact?
#5
@
3 years ago
I'm not entirely sure how backporting works for these files, but it's worth emphasizing that the same code lives in the Gutenberg plugin in https://github.com/WordPress/gutenberg/tree/trunk/lib/block-supports. I'm sure these files aren't copied automatically, but if you agree on the changes, we will have to apply the same set of changes in the Gutenberg plugin. I can see how these changes would improve performance by using language constructs like instanceof and isset.
A separate discussion would be how to make it easier to sync code between WordPress core and Gutenberg for block supports.
#6
@
3 years ago
Guterberg PR - https://github.com/WordPress/gutenberg/pull/54835
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/59453#ticket