Skip to content

Kirby 5.0.4

$pageActions->changeStatus()

Change the status of the current page to either draft, listed or unlisted. If changing to listed, you can pass a position for the page in the siblings collection. Siblings will be resorted.

$pageActions->changeStatus(string $status, int|null $position = null): Kirby\Cms\PageActions

Parameters

Name Type Default Description
$statusrequired string no default value "draft", "listed" or "unlisted"
$position intornull null Optional sorting number

Return type

Kirby\Cms\PageActions

This method does not modify the existing $pageactions object but returns a new object with the changes applied. Learn more →

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException If an invalid status is being passed

Parent class

Kirby\Cms\PageActions