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
Name | Type(s) | Description |
---|
$page | Page | Page to save |
$options (optional) | array | Optional array with the following optional elements: uncacheAll (bool): Whether the memory cache should be cleared Default:trueresetTrackChanges (bool): Whether the page's change tracking should be reset Default:truequiet (bool): When true, created/modified time+user will use values from $page rather than current user+time Default:falseadjustName (bool): Adjust page name to ensure it is unique within its parent Default:trueforceID (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:falsenoHooks (bool): Prevent before/after save hooks from being called Default:falsenoFields (bool): Bypass saving of custom fields Default:falsecaller (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:
$pages->editor methods and properties
API reference based on ProcessWire core version 3.0.252