Uses
| Uses | Description |
|---|---|
| wp-includes/post.php: get_post_custom_keys() | Retrieve meta field names for a post. |
| wp-includes/post.php: delete_post_meta() | Deletes a post meta field for the given post ID. |
Delete all oEmbed caches. Unused by core as of 4.0.0.
(int) (Required) Post ID to delete the caches for.
File: wp-includes/class-wp-embed.php
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 );
}
}
}
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_embed/delete_oembed_caches