Code to clear cache after deletion

Public

Warning message

We recommend you to assign at least one category to this snippet so you could easily navigate it in the future. Edit your snippet here.

Another point worth bearing in mind—I don’t see all modules taking care of this—is that when you delete variables it is good to also clear the variable cache. Only some of the modules which delete variables using db_delete() seem to remember this:

Get raw version
php
  1. cache_clear_all('variables', 'cache_bootstrap');