Mikesoft TeamVault exposes WordPress actions and filters for integrations, policy customization, and operational observability.
Hook names are defined in includes/class-mstv-hooks.php.
Runs after a file record is created.
Parameters:
int $fileIdarray $fileData
Payload keys currently include:
display_namefolder_idextensionmime_typefile_size
add_action('mstv_file_uploaded', function (int $fileId, array $fileData): void {
error_log('Uploaded file ID: ' . $fileId);
}, 10, 2);Runs after a file record and its stored file are deleted.
Parameters:
int $fileIdarray $fileData
Payload keys currently include:
display_namefolder_idrelative_path
Runs after a file display name is updated.
Parameters:
int $fileIdstring $oldNamestring $newName
Runs after a file is moved to another folder.
Parameters:
int $fileId?int $oldFolderId?int $newFolderId
Runs before the binary download stream is sent.
Parameters:
int $fileIdarray $fileData
Payload keys currently include:
display_nameextensionmime_type
Runs before the preview stream is sent.
Parameters:
int $fileIdarray $fileData
Payload keys currently include:
display_nameextensionmime_type
Runs after a folder record is created.
Parameters:
int $folderIdarray $folderData
Payload keys currently include:
nameparent_idrelative_path
Runs after a folder is deleted.
Parameters:
int $folderIdstring $folderName
Runs after a folder rename completes.
Parameters:
int $folderIdstring $oldNamestring $newName
Runs after a folder is moved under a different parent folder.
Parameters:
int $folderId?int $oldParentId?int $newParentId
$oldParentId and $newParentId are null for folders at the storage root.
Runs when a ZIP export starts.
Parameters:
?int $folderIdstring $zipPath
$folderId is null for selected-folder exports that are built as a combined archive.
Runs after a ZIP export archive is created and before it is streamed.
Parameters:
?int $folderIdstring $zipPathint $filesCount
Runs when a request is rejected by the per-folder permission engine (since 2.6).
Parameters:
int $userId?int $folderId(nullfor the storage root)string $action(one ofview,upload,download,delete,manage)
add_action('mstv_access_denied', function (int $userId, ?int $folderId, string $action): void {
error_log(sprintf('TeamVault denied %s on folder %s for user %d', $action, $folderId ?? 'root', $userId));
}, 10, 3);Filters the resolved allowed upload extensions.
Parameters:
array $extensions
add_filter('mstv_allowed_extensions', function (array $extensions): array {
$extensions[] = 'md';
return array_values(array_unique($extensions));
});Filters the maximum file size in bytes.
Parameters:
int $bytes
Filters the resolved storage path after plugin settings are applied.
Parameters:
string $path
add_filter('mstv_storage_path', function (string $path): string {
return WP_CONTENT_DIR . '/teamvault-private';
});Filters the display name used during upload before final normalization.
Parameters:
string $namestring $originalName
Filters the final upload validation result.
Parameters:
array $resultarray $files
The $result array currently contains:
valid(bool)errors(array)extension(string, when available)mime_type(string, when available)size(int, when available)
add_filter('mstv_upload_validation', function (array $result, array $files): array {
if (($result['valid'] ?? false) && str_ends_with(strtolower((string) ($files['name'] ?? '')), '.csv')) {
$result['errors'][] = 'CSV uploads are disabled by site policy.';
$result['valid'] = false;
}
return $result;
}, 10, 2);- These hooks are intended for WordPress customizations and must be used from site code, custom plugins, or mu-plugins.
- Hook payloads reflect the current implementation and may expand in future releases.