GC_Embed::delete_oembed_caches()
最后更新于:2021-11-27 14:40:12
GC_Embed::delete_oembed_caches( int$post_ID)Delete all oEmbed caches. Unused by core as of 4.0.0.
参数
- $post_ID
-
(int) (Required) Post ID to delete the caches for.
源文件
文件: gc-includes/class-gc-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 );
}
}
}