-
-
Save Mediatros/3e0c922bac7cf25a51ecde8175ab231c to your computer and use it in GitHub Desktop.
WP DIVI Bouton pour vider le cache local de Divi - Traduction FR
This file contains hidden or 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 | |
function ClearLocalCacheButton() { ?> | |
// Creation du bouton | |
<a href="#" onclick="ClearLocalCache()" class="et-pb-layout-buttons et-pb-layout-buttons-cache" title="Clear Cache"> | |
<span>Vider le cache</span> | |
</a> | |
<script type="text/javascript"> | |
// Place le bouton dans la barre d'onglets | |
jQuery(window).load(function(){ | |
jQuery(".et-pb-layout-buttons-cache").insertAfter(jQuery(".et-pb-layout-buttons-clear")); | |
}); | |
function ClearLocalCache() { | |
// Vide le cache et alerte l'utilisateur | |
alert("Le stockage des données en local a été effacé. Cliquez sur \"Mettre à jour\"."); | |
window.localStorage.clear() | |
} | |
</script> | |
<?php } | |
add_action('admin_footer', 'ClearLocalCacheButton'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment