WP_Embed::delete_oembed_caches( int $post_id )

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


Parameters

$post_id int Required
Post ID to delete the caches for.

Top ↑

Source

File: wp-includes/class-wp-embed.php. View all references

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 ( str_starts_with( $post_meta_key, '_oembed_' ) ) {
			delete_post_meta( $post_id, $post_meta_key );
		}
	}
}


Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.