Ticket #22190: 22190.diff
File 22190.diff, 1.3 KB (added by , 13 years ago) |
---|
-
wp-includes/class-wp-embed.php
25 25 // Attempts to embed all URLs in a post 26 26 add_filter( 'the_content', array( $this, 'autoembed' ), 8 ); 27 27 28 // Aftera post is saved, invalidate the oEmbed cache29 add_action( ' save_post', array( $this, 'delete_oembed_caches' ) );28 // When a post is saved, invalidate the oEmbed cache 29 add_action( 'pre_post_update', array( $this, 'delete_oembed_caches' ) ); 30 30 31 31 // After a post is saved, cache oEmbed items via AJAX 32 32 add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) ); … … 201 201 * @param int $post_ID Post ID to delete the caches for. 202 202 */ 203 203 function delete_oembed_caches( $post_ID ) { 204 $post_metas = get_post_custom_keys( $post_ID ); 205 if ( empty($post_metas) ) 204 if ( ! $meta = get_post_meta( $post_ID ) ) 206 205 return; 207 208 foreach( $post_metas as $post_meta_key ) { 209 if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) ) 210 delete_post_meta( $post_ID, $post_meta_key ); 206 foreach ( $meta as $key => $values ) { 207 if ( '_oembed_' == substr( $key, 0, 8 ) ) 208 delete_post_meta( $post_id, $key ); 211 209 } 212 210 } 213 211