<?php

// page.update:after && page.changeStatus:after
return function($newPage, $oldPage) {  
  $project = $newPage->template() == 'project' ? $newPage : $newPage->parents()->findBy('template', 'project');
  if ($project) {
    $steps = $project->rebuildStepsCache();
  }
};