#59453 closed enhancement (fixed)
Replace property_exists call in block api with instanceof
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Editor | Keywords: | has-patch gutenberg-merge |
Focuses: | coding-standards | Cc: |
Description
Remove calls this in block functions
property_exists( $block_type, 'supports' )
with
$block_type instanceof WP_Block_Type
Change History (9)
This ticket was mentioned in PR #5308 on WordPress/wordpress-develop by @spacedmonkey.
2 months ago
#1
- Keywords has-patch added
#4
@
2 months ago
@spacedmonkey Could you share some benchmarks or profiles here in regards to the performance impact?
#5
@
2 months 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
@
2 months ago
Guterberg PR - https://github.com/WordPress/gutenberg/pull/54835
Trac ticket: https://core.trac.wordpress.org/ticket/59453#ticket