WordPress at Your Fingertips

WP_Embed::delete_oembed_caches() WP 1.0

Delete all oEmbed caches. Unused by core as of 4.0.0.

{} It's a method of the class: WP_Embed{}

No Hooks.

Return

null. Nothing.

Usage

global $wp_embed;
$wp_embed->delete_oembed_caches( $post_ID );
$post_ID(int) (required)
Post ID to delete the caches for.

Code of WP_Embed::delete_oembed_caches() WP 5.8.1

public function delete_oembed_caches( $post_ID ) {
	$post_metas = get_post_custom_keys( $post_ID );
	if ( empty( $post_metas ) ) {
		return;
	}

	foreach ( $post_metas as $post_meta_key ) {
		if ( '_oembed_' === substr( $post_meta_key, 0, 8 ) ) {
			delete_post_meta( $post_ID, $post_meta_key );
		}
	}
}

oEmbed (WP response to embed request)

cache (caching)

Other

No comments
    Log In