WordPress Clear oEmbed Cache Automatically on Post Save
<?php | |
add_action( 'save_post', function( $post_id ) { | |
if( get_post_type( $post_id ) != WPEP_POST_TYPE_COURSE ) | |
return; | |
global $wpdb; | |
$wpdb->query( 'DELETE FROM `' . $wpdb->postmeta . '` WHERE `meta_key` LIKE "_oembed%" AND post_id = ' . $post_id ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment