PagesTrash::trasher method
Get info needed to restore a Page that is in the trash
Returns array with the following info:
restorable
(bool): Is the page restorable to a previous known/existing parent?notes
(array): Any additional notes to explain restore info (like reason why not restorable, or why name changed, etc.)parent
(Page|NullPage): Parent page that it should restore toparent_id
(int): ID of parent page that it should restore tosort
(int): Sort order that should be restored to pagename
(string): Name that should be restored to page’s “name” property.namePrevious
(string): Previous name, if we had to modify the original name to make it restorable.name{id}
(string): Name that should be restored to language where {id} is language ID (if appliable).
Usage
// basic usage
$array = $pages->trasher->getRestoreInfo(Page $page);
// usage with all arguments
$array = $pages->trasher->getRestoreInfo(Page $page, bool $populateToPage = false);
Arguments
Name | Type(s) | Description |
---|---|---|
$page | Page | Page to restore |
$populateToPage (optional) | bool | Populate this information to given page? Default:false |
Return value
array
$pages->trasher methods and properties
API reference based on ProcessWire core version 3.0.252