Keeps track of past URLs where pages have lived and automatically redirects (301 permanent) 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.
Common
Name | Return | Summary | |
---|
PagePathHistory::addPathHistory() PagePathHistory::addPathHistory(Page $page, string $path) PagePathHistory::addPathHistory(Page $page, string $path, $language = null) | bool | Add a history path for a page | |
PagePathHistory::deleteAllPathHistory() PagePathHistory::deleteAllPathHistory($page) PagePathHistory::deleteAllPathHistory($page) | (nothing) | Delete all path history for a given Page or for all pages | |
PagePathHistory::deletePathHistory() PagePathHistory::deletePathHistory(Page $page, string $path) PagePathHistory::deletePathHistory(Page $page, string $path) | int | Delete path entry for given page and path | |
PagePathHistory::getPage() PagePathHistory::getPage(string $path) PagePathHistory::getPage(string $path, int $level = 0) | Page NullPage | Given a previously existing path, return the matching Page object or NullPage if not found. | |
PagePathHistory::getPathHistory() PagePathHistory::getPathHistory(Page $page) PagePathHistory::getPathHistory(Page $page, $options = []) | array | Get an array of all paths the given page has previously had, oldest to newest | |
PagePathHistory::getPathInfo() PagePathHistory::getPathInfo(string $path) PagePathHistory::getPathInfo(string $path, array $options = []) | array | Get array of info about a path if it is in history | |
PagePathHistory::getRootSegments() PagePathHistory::getRootSegments() PagePathHistory::getRootSegments() | array | Get all root segments | |
PagePathHistory::isRootSegment() PagePathHistory::isRootSegment(string $segment) PagePathHistory::isRootSegment(string $segment) | bool | Is/was given segment ever a root segment? | |
PagePathHistory::minimumAge | int | | |
PagePathHistory::rootSegments | array bool | | |
PagePathHistory::setPathHistory() PagePathHistory::setPathHistory(Page $page, string $path) PagePathHistory::setPathHistory(Page $page, string $path, $language = null) | bool | Set a history path for a page and delete any existing entries for page’s current path | |
PagePathHistory::upgrade() PagePathHistory::upgrade(int $fromVersion, int $toVersion) PagePathHistory::upgrade(int $fromVersion, int $toVersion) | (nothing) | Upgrade PagePathHistory module schema | |
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.236