How to find out if an wp-admin action edited a file?

The system redirects after an update with updated=true. You could check for that GET parameter on the load-theme-editor.php hook, something like:

add_action(
  'load-theme-editor.php',
  function() {
    if (isset($_GET['updated']) && true == $_GET['updated']) {
      // clear the cache
    }
  }
);

I looked for more specific hooks and couldn’t find any, by the way.

Leave a Comment