Find latest modified (sub)child of a page

Problem

A page has got a possibly deeply nested children structure and you want to get the latest modified child of that page.

Solution

$lastModifiedChild = $page->find("id>0,sort=-modified")->first;

Resources

Version

1.0.0

View/correct recipe on GitHub

https://github.com/processwire-recipes/Recipes/blob/master/find-latest-modified-child.md

Author(s)