Help topics

Morphic hooks and filters reference

This page lists the WordPress actions and filters that Morphic (the free plugin) runs.

Actions

Morphic runs these actions. Arguments are listed in the order they are passed.

ActionWhen it runsArguments
morphic/readyOn init, priority 5.None.
morphic/restWhen REST routes are registered.RouteRegistrar object.
morphic/model_savedAfter a model is saved.$manifest.
morphic/manifest/checkWhen a model is checked.$manifest, $registry.
morphic/writingBefore an entry is written.$manifest, cleaned data, previous data or null, actor.
morphic/writtenAfter an entry is written.Store, $manifest, node, previous node or null, changed field names, create, update or restore.
morphic/deletingBefore an entry is deleted.Store, $manifest, node, time.
morphic/deletedAfter an entry is deleted.Store, $manifest, node, time.
morphic/clearedAfter an entry is cleared.Store, entry ID.
morphic/refreshWhen nodes are refreshed.Store, $manifest, nodes.
morphic/workIn each background build run.Store, deadline.
morphic/key_usedOn every matching API key request, before the throttle check.API key record.
morphic/webhook_deliveredAfter each webhook attempt.Hook, operation, HTTP code (0 when the request fails), error message or null.

Filters

Morphic applies these filters. Return a value of the same type as the default.

FilterDefaultArguments
morphic/pro['active' => false, 'licensed' => false, 'features' => []]None. Read in Admin.php and Rest.php.
morphic/upgrade_url'https://morphicwp.com'None.
morphic/i18nMessages from I18n::messages('morphic', MORPHIC_FILE).Messages array.
morphic/fast_urlnullNone.
morphic/pathsPaths of the type response.Paths, $manifest.
morphic/openapi/pathsPaths of the OpenAPI document.Paths.
morphic/openapi/schemasSchemas of the OpenAPI document.Schemas.
morphic/can_fullfalse$allowed, $manifest. Runs only for the full action, after the API key check fails. Its result decides the action.
morphic/shapeNode as shaped for the reader.Node, $manifest, $full.
morphic/unsealnull$plain, stored value, field, $manifest. Runs for sealed fields when the reader has full access. A value that is not a string is replaced with the redacted value.
morphic/sealnull$plain string, field, $manifest. Must return a string. Without one, the save fails with "{field} is a sealed field; sealing needs Morphic Pro".
morphic/write_cost0Cost value, $manifest.
morphic/kinds['node', 'component']Kinds list.
morphic/secret_kinds['hash']Secret kinds list.
morphic/structuresIndex structures of the model.Structures, $manifest.
morphic/pendingfalsePending flag.
morphic/fill_batch200Batch size, type, structure, name.
morphic/fill_manyNodes.Nodes, Store, $manifest, structure, name.
morphic/fillnullnull, Store, $manifest, structure, name, node. A non-null return value is used as the error message.
morphic/clear00, Store, type, structure, name, limit.

Notes