Ah, no. It means you’ll have to rewrite a bit. Let me show you.
Replace
//Use MODX function to get children.
$parents = split(',', $parent);
$pages = Array();
foreach($parents as $par) {
$pages = array_merge($pages,$modx->getDocumentChildren($par, 1, 0, $fields, $where, $sortBy, $sortHow, $limit));
}
With
//Use MODX function to get documents
$parents = split(',', $parent);
$pages = Array();
foreach($parents as $par) {
$page = $modx->getDocument($par, $fields, 1, 0);
array_push($pages, $page);
}
What this will do is retrieve the page with the ID you give to the function (seperated by comma’s if you want to give more id’s).
Technically speaking, what we did is replace the merge with a push function, as the result of the get-document is not an array of documents, but simply one document object.
Now, documents are represented as arrays as well, that’s just how PHP works. So, the $pages ’array’ holds several $page ’arrays’ in both situations. But in the first it’s based on the parents (which retrieve one-or-more documents) and in the second it’s based on the actual document (Which will always retrieve only one)
Anyway, with this minimal edit, it should do what you require (and more!) though ’filters’ will no longer work, obviously, as you’re retrieving specific ID’s.