Skip to content

Actions ​

Registration ​

ActionArgumentsFires
vxframework/registerCode_Registry $registryOnce per request on init (priority 0), to define objects in PHP.
vxframework/abilities/registerstring $registry_classWhen VX registers its abilities, to add your own.
vxframework/dictionary/registernoneWhen system dictionaries load, to add providers.

Config as code ​

ActionArgumentsFires
vxframework/config/file_writtenstring $type, string $key, array $config, string $fileAfter VX writes an object to a project JSON file.
vxframework/config/file_deletedstring $type, string $key, array $config, string $fileAfter a project file is deleted (detach).
vxframework/config/db_copy_discardedstring $type, string $key, array $config, string $reasonAfter a database copy is discarded in favor of the code definition.

Revisions ​

ActionArgumentsFires
vxframework/config_revisions/before_persiststring $entity_type, string $key, array $old, array $newBefore a fieldset save is recorded.
vxframework/config_revisions/recordedint $revision_id, string $entity_type, string $keyAfter a revision is stored.
vxframework/config_revisions/before_restorestring $entity_type, string $key, int $revision_id, array $snapshotBefore a fieldset revision is restored.
vxframework/config_revisions/after_restorestring $entity_type, string $key, int $revision_idAfter a fieldset revision is restored.

Content and data ​

ActionArgumentsFires
vxframework/fieldsets/media/post_uploadint $attachment_id, array $field, $fieldset, int $entity_id, int $user_idAfter a file is uploaded through a media field.
vxframework/fieldsets/files/post_uploadsameAfter a file is uploaded through a Files field.
vxframework/field_migrations/meta_key_changedstring $meta_type, string $old_key, string $new_key, int[] $object_idsAfter Meta Watch moves values to a new key.
vxframework/option_page/before_deleteint $page_id, string $keyBefore an option page and its values are deleted.
vxframework/dictionary/before_deletestring $keyBefore a dictionary is deleted.

For example, to purge a page cache when a file upload lands:

php
add_action( 'vxframework/fieldsets/media/post_upload', function ( int $attachment_id, array $field, $fieldset, int $entity_id ) {
    my_cache_purge_post( $entity_id );
}, 10, 4 );
Technical details for LLMs
  • $type values: post_type, taxonomy, fieldset. $config is the portable (export-normalized) config.
  • $type is also option_page and dictionary.
  • vxframework/config_revisions/* actions fire from the fieldset model; other entity types record revisions without these before/after hooks.
  • vxframework/field_migrations/meta_key_changed $meta_type: post, term or user.

Documentation for the VX Framework.