[wp-trac] [WordPress Trac] #63667: Delete oEmbed postmeta if the related embed block is deleted / no longer present in the content

WordPress Trac noreply at wordpress.org
Wed Jul 9 23:18:16 UTC 2025


#63667: Delete oEmbed postmeta if the related embed block is deleted / no longer
present in the content
-------------------------------------------------+-------------------------
 Reporter:  oglekler                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Embeds                               |     Version:  2.9
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests has-test-   |     Focuses:
  info dev-feedback                              |
-------------------------------------------------+-------------------------

Comment (by SirLouen):

 === More info

 After further testing by adding and editing new embeds, I've not really
 been able to get pass through [https://github.com/SirLouen/wordpress-
 develop/blob/6bc94efc15e0be4ebfd9a209cfd2f1b65bab8f7c/src/wp-includes
 /class-wp-embed.php#L87 this line]. It's true that I've been only playing
 with Gutenberg. Maybe with Classic Editor there is a different song.

 What I've been trying to figure out is the utility of
 `maybe_run_ajax_cache` with this `message` parameter supposedly received
 somehow because I cannot see other references in the code and I can't
 really trigger it to debug what it could be receiving.

 This oEmbed logic has been like this since [12023] completely unchanged. I
 can't find anything enlightening reading through #10337 either. In fact,
 this was first introduced
 [https://core.trac.wordpress.org/attachment/ticket/10337/10337.workinprogress.3.patch
 in this patch in that ticket] and all the information we have about this
 decision is:

 > Move oEmbed caching to an AJAX request after the post is saved

 @azaozz was there 16 years ago. Possibly, he can figure out what is this
 all about.

 For now, preemptively, I'm going to leave untouched both calls to this
 AJAX thing, in case there is some backwards compatibility topic with
 Classic Editor, but for the current status of the oEmbed, I can't really
 see the utility of calling such function, instead of calling directly
 `cache_oembed` which is the function that `maybe_run_ajax_cache` ends
 calling after those unknown checks.

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


More information about the wp-trac mailing list