PagePathHistory class

Keeps track of past URLs where pages have lived and automatically 301 redirects

to the new location whenever the past URL is accessed.


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the PagePathHistory class also inherits all the methods and properties of: WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
PagePathHistory::addPathHistory(Page $page, string $path)
bool

Add a history path for a page

 
PagePathHistory::deleteAllPathHistory($page)
None

Delete all path history for a given Page or for all pages

 
PagePathHistory::deletePathHistory(Page $page, string $path)
int

Delete path entry for given page and path

 
PagePathHistory::getPage(string $path)
Page NullPage

Given a previously existing path, return the matching Page object or NullPage if not found.

 
PagePathHistory::getPathHistory(Page $page)
array

Get an array of all paths the given page has previously had, oldest to newest

 
PagePathHistory::getPathInfo(string $path)
array

Get array of info about a path if it is in history

 
PagePathHistory::getRootSegments()
array

Get all root segments

 
PagePathHistory::isRootSegment(string $segment)
bool

Is/was given segment ever a root segment?

 
PagePathHistory::setPathHistory(Page $page, string $path)
bool

Set a history path for a page and delete any existing entries for page’s current path

 
PagePathHistory::upgrade(int $fromVersion, int $toVersion)
None

Upgrade PagePathHistory module schema

Properties

NameReturnSummary 
PagePathHistory::minimumAge int 
PagePathHistory::rootSegments array bool 

Additional methods and properties

In addition to the methods and properties above, PagePathHistory also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252