Created
November 9, 2015 13:31
-
-
Save JulioPotier/e03703d3f4d2e6d1ab6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Empty Embeds cache | |
* Description: You already read it | |
* Version: 1.0 | |
* Author: Julio Potier | |
* Author URI: https://wp-rocket.me | |
* License: GPLv2+ | |
* | |
*/ | |
add_action( 'plugins_loaded', 'empty_embed_cache' ); | |
function empty_embed_cache() { | |
global $wpdb; | |
$wpdb->query( 'DELETE from ' . $wpdb->postmeta . ' WHERE meta_key LIKE "_oembed_%"' ); | |
wp_die( 'Cache emptied, please now remove this file : <b>' . __FILE__ . '</b>' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment