Skip to content

Instantly share code, notes, and snippets.


Doc gWorldz gWorldz

View GitHub Profile
View multisite_delete_revisions.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:
// This snippet is meant to be called as a standalone script.
// Like
View relative recursive.php
function ZipFolder($folder, $to='', $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)));