Skip to content

Instantly share code, notes, and snippets.

@ngearing
Created March 9, 2017 03:28
Show Gist options
  • Save ngearing/c2a0af938dc662cc6fca6d4530f82de3 to your computer and use it in GitHub Desktop.
Save ngearing/c2a0af938dc662cc6fca6d4530f82de3 to your computer and use it in GitHub Desktop.
ACF Pro update db script works on manageWP
<?php
include $_SERVER['DOCUMENT_ROOT'].'/wp-content/plugins/advanced-custom-fields-pro/acf.php';
include $_SERVER['DOCUMENT_ROOT'].'/wp-content/plugins/advanced-custom-fields-pro/admin/install.php';
$acf_admin = new acf_admin_install();
$updates = acf_get_db_updates();
$message = '';
// bail early if no updates
if (empty($updates)) {
echo acf_get_db_version();
return;
}
// install updates
foreach ($updates as $version => $callback) {
$message .= $acf_admin->run_update($callback);
}
// updates complete
acf_update_db_version();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment