We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_action('wp_uninitialize_site', NAMESPACE . '\clear_mappings_on_delete');
/**
Clear mappings for a site when it's deleted
@param obj $site Site object that is being deleted */ function clear_mappings_on_delete($site) { $mappings = Mapping::get_by_site($site->blog_id);
if (empty($mappings)) { return; }
foreach ($mappings as $mapping) { $error = $mapping->delete();
if (is_wp_error($error)) { $message = sprintf( __('Unable to delete mapping %1$d for site %2$d', 'mercator'), $mapping->get_id(), $site_id ); trigger_error($message, E_USER_WARNING); }
} }
The text was updated successfully, but these errors were encountered:
Switch from 'delete_blog' hook to 'wp_uninitialize_site'.
dbc226b
'delete_blog' was deprecated in WordPress 5.1.0. Fixes humanmade#108, humanmade#113.
No branches or pull requests
add_action('wp_uninitialize_site', NAMESPACE . '\clear_mappings_on_delete');
/**
Clear mappings for a site when it's deleted
@param obj $site Site object that is being deleted
*/
function clear_mappings_on_delete($site)
{
$mappings = Mapping::get_by_site($site->blog_id);
if (empty($mappings)) {
return;
}
foreach ($mappings as $mapping) {
$error = $mapping->delete();
}
}
The text was updated successfully, but these errors were encountered: