---
title: "modal_kit_pro_pre_rollback – Modal Kit Docs"
description: "Refuse or take over a rollback from the License tab, for hosts and deployments that manage plugin files themselves."
language: "en-US"
canonical_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/"
source_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/"
content_type: "text/markdown"
---

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

Hooks ▾

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

[Docs](https://modalkitwp.com/docs/) / [Hooks](https://modalkitwp.com/docs/hooks/) / Pro · Updates

# `modal_kit_pro_pre_rollback`

filter

Pro

PHP

Refuse or take over a rollback from the License tab, for hosts and deployments that manage plugin files themselves.

Runs when someone rolls Pro back to an earlier version on **Modal Kit → Settings → License**, after Pro has checked the license and the version and fetched a fresh download link, just before it installs the package.

Return null to let Pro install it, the way the Plugins screen installs an update. Return true when your own code has installed that version, or a `WP_Error` to stop; its message is shown on the License tab.

## Parameters

Parameter

Description

`$result`

null|true|WP_Error

null.

`$package`

string

The download link for that version. It’s tied to the license and may be short-lived, so don’t log or share it.

`$version`

string

The version to roll back to.

## Returns

`null|true|WP_Error` null to install here, true when it’s installed, or an error to stop.

## Examples

### Refuse on a site deployed from Git

PHP

```
add_filter( 'modal_kit_pro_pre_rollback', function () {
  return new WP_Error(
    'my_deployed_from_git',
    __(
      'Plugins here are deployed from Git. Ask the developers to roll back.',
      'my-plugin'
    )
  );
} );
```

### Ask your operations team instead

The email names the version, not the download link.

PHP

```
add_filter(
  'modal_kit_pro_pre_rollback',
  function ( $result, $package, $version ) {
    wp_mail(
      'ops@agency.example',
      sprintf( 'Roll back Modal Kit Pro on %s', home_url() ),
      sprintf( 'Requested version: %s', $version )
    );

    return new WP_Error(
      'my_rollback_requested',
      sprintf(
        /* translators: %s: version number */
        __( 'Our team has been asked to install version %s.', 'my-plugin' ),
        $version
      )
    );
  },
  10,
  3
);
```

Good to know

Return only null, true or a `WP_Error`. Any other value skips the install, and the License tab still reports success.

After true, Pro records the version change and, unless updates are already paused, pauses them for a week so the newer version isn’t installed straight back.

Only users who can `update_plugins` can roll back, only where WordPress allows file changes (`DISALLOW_FILE_MODS` hides it), and only on the site that manages updates: the main site on a network.

Applied in `modal-kit-pro/includes/Updates.php`.

Related

[`modal_kit_pro_tested_up_to`](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

[`modal_kit_pro_is_staging`](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

## Need a hook that isn’t here?

[Ask us](https://modalkitwp.com/support/)

[Developers overview](https://modalkitwp.com/developers/)
