PagesEditor::editor method

Permanently delete a page and its fields.

Unlike trash(), pages deleted here are not restorable.

If you attempt to delete a page with children, and don't specifically set the $recursive param to True, then this method will throw an exception. If a recursive delete fails for any reason, an exception will be thrown.

Usage

// basic usage
$bool = $pages->editor->delete(Page $page);

// usage with all arguments
$bool = $pages->editor->delete(Page $page, $recursive = false, array $options = []);

Arguments

NameType(s)Description
$pagePage
$recursive (optional)bool array

If set to true, then this will attempt to delete all children too. If you don't need this argument, optionally provide $options array instead.

$options (optional)array

Optional settings to change behavior:

  • uncacheAll (bool): Whether to clear memory cache after delete Default:false
  • recursive (bool): Same as $recursive argument, may be specified in $options array if preferred.

Return value

bool int

Returns true (success), or integer of quantity deleted if recursive mode requested.

Exceptions

Method can throw exceptions on error:

  • WireException - on fatal error


$pages->editor methods and properties

API reference based on ProcessWire core version 3.0.252