PagesParents::parents method
Get parents for given Page and/or specific columns from them
- Return value has no exclusions for access control or status.
- Return value order is closest parent to furthest.
- This attempts to return all pages in 1 optimized query, making it potentially faster than other methods.
- When using
column
orcolumns
options, specify only one or the other, and include column(s) native to pages DB table only, with 1 exception—you may specifypath
as a column, which will return the generated page path(s).
Available since version 3.0.156.
Usage
// basic usage
$array = $pages->parents->getParents($page);
// usage with all arguments
$array = $pages->parents->getParents($page, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
$page | Page int | Page or page ID |
$options (optional) | array |
|
Return value
$pages->parents methods and properties
API reference based on ProcessWire core version 3.0.252