Created
January 3, 2018 11:39
-
-
Save SJ-James/2034db86ed54dea09fa0ed4920261660 to your computer and use it in GitHub Desktop.
Clear Local Storage Button For Divi
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 | |
function ClearLocalCacheButton() { ?> | |
// Create Button | |
<a href="#" onclick="ClearLocalCache()" class="et-pb-layout-buttons et-pb-layout-buttons-cache" title="Clear Cache"> | |
<span>Clear Cache</span> | |
</a> | |
<script type="text/javascript"> | |
// Move Button to Divi Tabs | |
jQuery(window).load(function(){ | |
jQuery(".et-pb-layout-buttons-cache").insertAfter(jQuery(".et-pb-layout-buttons-clear")); | |
}); | |
function ClearLocalCache() { | |
// Clear Storage and Alert User | |
alert("Local storage has been cleared. Update the page now."); | |
window.localStorage.clear() | |
} | |
</script> | |
<?php } | |
add_action('admin_footer', 'ClearLocalCacheButton'); |
Hi !
Is it still useful for new Divi version ?
Many thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Working great for me. Thanks very much for the share! :)