My plugin needs to know when the title of a page was changed. Therefore i hook into "IO_WIKIPAGE_WRITE" (AFTER) and compare current title with the previous one. If there is no previous (attic) version, there is no change.
The code i use to utilize the first heading for the current page is:
$curr = p_get_first_heading($ID);
And the one to get the same info from an attic version looks like this:
$last = $INFO['meta']['last_change']['date'];
$txt = rawWiki($ID,$last)
if (preg_match('/^==+(.+?)==+/',$txt,$match))
{
$title = trim($match[1]);
}
Maybe this is too complicated and there is a way to access the first title from the attic metadata?