public function set_rollback($update_data)
{
if (empty($_GET['rollback']) && !isset($_GET['action'])) {
return $update_data;
}
if (isset($_GET['plugin']) && 'upgrade-plugin' === $_GET['action']) {
$slug = dirname($_GET['plugin']);
$type = 'plugin';
}
if (isset($_GET['theme']) && 'upgrade-theme' === $_GET['action']) {
$slug = $_GET['theme'];
$type = 'theme';
}
if (!empty($slug) && array_key_exists($slug, $this->config)) {
$repo = $this->config[$slug];
$this->set_rollback_transient($type, $repo);
}
return $update_data;
}