You are here

function mailchimp_signup_invalidate_cache in Mailchimp 2.x

Invalidates Mailchimp related cache, useful when altering a signup form.

2 calls to mailchimp_signup_invalidate_cache()
MailchimpSignupDeleteForm::submitForm in modules/mailchimp_signup/src/Form/MailchimpSignupDeleteForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…
MailchimpSignupForm::save in modules/mailchimp_signup/src/Form/MailchimpSignupForm.php
Form submission handler for the 'save' action.

File

modules/mailchimp_signup/mailchimp_signup.module, line 55
Creates signup forms integrated with Mailchimp.

Code

function mailchimp_signup_invalidate_cache() {
  \Drupal::cache('mailchimp')
    ->invalidateAll();
  if (\Drupal::moduleHandler()
    ->moduleExists('block')) {
    \Drupal::service('plugin.manager.block')
      ->clearCachedDefinitions();
  }
}