From 502908fa4c00b8d896d0f3a9d9b27b8222358c7e Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 5 Nov 2012 16:47:04 +0000 Subject: [PATCH] Invalidate oEmbed caches on pre_post_update instead of save_post so existing metadata caches may be used. fixes #22190. git-svn-id: https://develop.svn.wordpress.org/trunk@22369 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-wp-embed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php index 1455d5480d..9404ba408a 100644 --- a/wp-includes/class-wp-embed.php +++ b/wp-includes/class-wp-embed.php @@ -25,8 +25,8 @@ class WP_Embed { // Attempts to embed all URLs in a post add_filter( 'the_content', array( $this, 'autoembed' ), 8 ); - // After a post is saved, invalidate the oEmbed cache - add_action( 'save_post', array( $this, 'delete_oembed_caches' ) ); + // When a post is saved, invalidate the oEmbed cache + add_action( 'pre_post_update', array( $this, 'delete_oembed_caches' ) ); // After a post is saved, cache oEmbed items via AJAX add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );