[wp-trac] [WordPress Trac] #61495: Block Hooks: Refactor update_ignored_hooked_blocks_postmeta to use meta_input

WordPress Trac noreply at wordpress.org
Wed Jun 26 08:52:27 UTC 2024


#61495: Block Hooks: Refactor update_ignored_hooked_blocks_postmeta to use
meta_input
--------------------------------------+------------------------------
 Reporter:  tomjcafferkey             |       Owner:  Bernhard Reiter
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.7
Component:  General                   |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------
Changes (by Bernhard Reiter):

 * owner:  (none) => Bernhard Reiter
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58578" 58578]:
 {{{
 #!CommitTicketReference repository="" revision="58578"
 Block Hooks: Refactor controller filter to use meta_input.

 Prior to this changeset, the function
 `update_ignored_hooked_blocks_postmeta()` used the core function
 `update_post_meta()` to write `_wp_ignored_hooked_blocks` data to the
 database during an operation that is preparing a post to be inserted.

 Since we have access to the incoming changes that are being prepared we
 can remove this database operation in favour of writing the data to the
 post object provided under `meta_input`.

 Doing this means two things:

 1. It allows us to store postmeta for new posts that are about to be
 created since they don't have an `ID` yet (which is information
 `update_post_meta()` needs).
 2. The core controller will take care of updating postmeta in a more
 predictable pattern.

 Props tomjcafferkey, bernhard-reiter.
 Fixes #61495.
 }}}

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


More information about the wp-trac mailing list