PagesEditor::editor method

Save a page object and it's fields to database.

If the page is new, it will be inserted. If existing, it will be updated.

This is the same as calling $page->save()

If you want to just save a particular field in a Page, use $page->save($fieldName) instead.

Usage

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

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

Arguments

NameType(s)Description
$pagePage

Page to save

$options (optional)array

Optional array with the following optional elements:

  • uncacheAll (bool): Whether the memory cache should be cleared Default:true
  • resetTrackChanges (bool): Whether the page's change tracking should be reset Default:true
  • quiet (bool): When true, created/modified time+user will use values from $page rather than current user+time Default:false
  • adjustName (bool): Adjust page name to ensure it is unique within its parent Default:true
  • forceID (integer): Use this ID instead of an auto-assigned on (new page) or current ID (existing page)
  • ignoreFamily (bool): Bypass check of allowed family/parent settings when saving Default:false
  • noHooks (bool): Prevent before/after save hooks from being called Default:false
  • noFields (bool): Bypass saving of custom fields Default:false
  • caller (string): Optional name of calling function (i.e. 'pages.trash'), for internal use Default:'' 3.0.235+
  • callback (string|callable): Hook method name from $pages or callable to trigger after save. It receives a single $page argument. For internal use. Default:'' 3.0.235+

Return value

bool

True on success, false on failure

Exceptions

Method can throw exceptions on error:

  • WireException


$pages->editor methods and properties

API reference based on ProcessWire core version 3.0.252