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

WordPress Trac noreply at wordpress.org
Tue Jun 25 08:24:02 UTC 2024


#61495: Block Hooks: Refactor update_ignored_hooked_blocks_postmeta to use
meta_input
---------------------------+-----------------------------
 Reporter:  tomjcafferkey  |      Owner:  (none)
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 The function `update_ignored_hooked_blocks_postmeta` uses 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 is 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.

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


More information about the wp-trac mailing list