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
<pre><?php | |
function ZipFolder($folder, $to='archive.zip', $basedir) { | |
$zip = new ZipArchive(); | |
if ($zip->open($to, ZIPARCHIVE::CREATE)) { | |
$found = array(rtrim($folder,DIRECTORY_SEPARATOR.'\/')); | |
while ($path = each($found)) { | |
$path = current($path); | |
if (is_dir($path)) { | |
$zip->addEmptyDir(substr($path, strlen($basedir))); |
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 | |
// WordPress Multisite - Delete all revisions from all posts in a netword. | |
// Quick hack by @mrazzari, 2014. | |
// For context see this thread started by Kitchin at the forums: | |
// http://wordpress.org/support/topic/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere | |
// HOWTO | |
// This snippet is meant to be called as a standalone script. | |
// Like http://example.com/tmp/multisite_delete_revisions.php |