[wp-trac] [WordPress Trac] #59441: Use instanceof in block_has_support

WordPress Trac noreply at wordpress.org
Mon Sep 25 12:15:21 UTC 2023


#59441: Use instanceof in block_has_support
------------------------------+---------------------------
 Reporter:  spacedmonkey      |       Owner:  spacedmonkey
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  6.4
Component:  Editor            |     Version:  5.8
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  performance
------------------------------+---------------------------
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56678" 56678]:
 {{{
 #!CommitTicketReference repository="" revision="56678"
 Themes: Use instanceof in block_has_support.

 In [50761], the block_has_support function was introduced. However, using
 `property_exists` within this function negatively impacted its
 performance. This commit replaces the `property_exists` function call with
 `instanceof WP_Block_Type`, resulting in improved performance.

 Props mukesh27, gziolo, spacedmonkey.
 Fixes #59441.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59441#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list