All features

Cherry Blossom feature

Updates: Context

Provides version-transition data and non-destructive migration helpers.

Provides version-transition data and non-destructive migration helpers.

Capabilities and extension points

Describes the parent-version transition being processed.

Current lifecycle operation.

  • var string

Previously completed or detected parent version.

  • var string

Running parent version.

  • var string

Creates a migration context.

  • param string $operation Install or update operation.
  • param string $from_version Previously completed or detected parent version.
  • param string $to_version Running parent version.

Gets the current lifecycle operation.

  • return string Operation name.

Gets the previously completed or detected parent version.

  • return string Previously completed or detected version, or an empty string.

Gets the running parent version.

  • return string Running version.

Determines whether this is a clean installation operation.

  • return bool Whether this is an installation.

Adds an option without replacing a configured value.

Use this for compatibility defaults so an existing site's chosen value is retained during a migration.

  • param string $option Option name.
  • param mixed $value Option value.
  • return bool Whether the option was added.

Adds a theme modification without replacing a configured value.

Uses the active stylesheet theme-mod store, which belongs to the child theme when one is active. It is not a parent-specific storage namespace.

  • param string $name Theme modification name.
  • param mixed $value Theme modification value.
  • return bool Whether the theme modification was added.

Source reference

This editable reference page is based on the PHP documentation in updates/class-context.php.