[wp-trac] [WordPress Trac] #62716: Block Hooks: Absorb logic to set ignored hooked blocks post meta into `apply_block_hooks_to_content`

WordPress Trac noreply at wordpress.org
Wed Feb 19 21:10:47 UTC 2025


#62716: Block Hooks: Absorb logic to set ignored hooked blocks post meta into
`apply_block_hooks_to_content`
---------------------------------------+------------------------------
 Reporter:  Bernhard Reiter            |       Owner:  Bernhard Reiter
     Type:  defect (bug)               |      Status:  reopened
 Priority:  normal                     |   Milestone:  6.8
Component:  General                    |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  has-patch gutenberg-merge  |     Focuses:
---------------------------------------+------------------------------

Comment (by johnjamesjacoby):

 > We can still get the benefit of the type hint by making it nullable
 instead of removing it all together. This will work down to php7.1 which
 is below the minimum WP version.

 That syntax ''does'' get used on `ints` & `arrays` in a few random'ish
 places (SimplePie, `wp_getimagesize()`, etc...); just not with objects
 (and specifically not with `?WP_Post`).

 I'm not confident this ticket is the best place to introduce type hinting
 on a `$post` parameter that gets run through `the_content`.
 Hypothetically, plugins using the `the_content` filter on a non-`WP_Post`
 object would now fatal error when it would not previously, and that seems
 unintentional.

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


More information about the wp-trac mailing list