Deletes all oEmbed caches. Unused by core as of 4.0.0.
$post_idintrequired
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 );
}
}
}
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_embed/delete_oembed_caches