Skip to content

Actions and filters

Migrations: 47 hooks.

44 of the 47 have a description in the source.

12 actions35 filters

filter

davo_attachments_scan_file

This filter is documented in Attachments_Repository::scan_for_malware(). */

Passed to callbacks: array( 'clean' => true, 'reason' => '', )$path$mime$filename

add_filter
add_filter( 'davo_attachments_scan_file', 'my_filter_callback', 10, 4 );

function my_filter_callback( $arg1, $arg2, $arg3, $arg4 ) {
	// Change $arg1 as needed, then return it.
	return $arg1;
}

src/domains/migrations/media-library-migration-provider.php:332, and 1 more place

filter

davo_migration_allowed_sensitive_option_keys

Filter option keys that look sensitive but are safe to migrate.

Parameters of davo_migration_allowed_sensitive_option_keys
ParameterTypeDescription
$allowedstring[]Option keys to let through. Default empty.
$keystringThe key being checked.
add_filter
add_filter( 'davo_migration_allowed_sensitive_option_keys', 'my_filter_callback', 10, 2 );

/**
 * @param string[] $allowed
 * @param string $key
 */
function my_filter_callback( $allowed, $key ) {
	// Change $allowed as needed, then return it.
	return $allowed;
}

src/domains/migrations/helpers.php:964

filter

davo_migration_content_providers

Filter the providers that create postable content.

Parameters of davo_migration_content_providers
ParameterTypeDescription
$keysstring[]Provider keys.
add_filter
add_filter( 'davo_migration_content_providers', 'my_filter_callback', 10, 1 );

/**
 * @param string[] $keys
 */
function my_filter_callback( $keys ) {
	// Change $keys as needed, then return it.
	return $keys;
}

src/domains/migrations/helpers.php:934

action

davo_migration_export_completed

Fires once an export job's package is complete and downloadable.

Parameters of davo_migration_export_completed
ParameterTypeDescription
$job_idintCompleted job ID.
$job_dirstringAbsolute path to the package directory.
add_action
add_action( 'davo_migration_export_completed', 'my_action_callback', 10, 2 );

/**
 * @param int $job_id
 * @param string $job_dir
 */
function my_action_callback( $job_id, $job_dir ) {
	// Your code here.
}

src/domains/migrations/repository.php:1158

action

davo_migration_import_completed

Fires once an import job finishes, successfully or otherwise.

Parameters of davo_migration_import_completed
ParameterTypeDescription
$job_idintCompleted job ID.
$has_failuresboolWhether any records failed to import.
add_action
add_action( 'davo_migration_import_completed', 'my_action_callback', 10, 2 );

/**
 * @param int $job_id
 * @param bool $has_failures
 */
function my_action_callback( $job_id, $has_failures ) {
	// Your code here.
}

src/domains/migrations/repository.php:2887

action

davo_migration_job_cancelled

Fires when a job is cancelled, so Migrations_Initializer can clear any pending WP-Cron tick for it — the exact same cleanup pause_job() needs, and for the same reason (see that method's own docblock on keeping WP-Cron specifics out of this class entirely).

Parameters of davo_migration_job_cancelled
ParameterTypeDescription
$job_idintCancelled job ID.
add_action
add_action( 'davo_migration_job_cancelled', 'my_action_callback', 10, 1 );

/**
 * @param int $job_id
 */
function my_action_callback( $job_id ) {
	// Your code here.
}

src/domains/migrations/repository.php:2305

action

davo_migration_job_created

Fires after a new migration job is created.

Parameters of davo_migration_job_created
ParameterTypeDescription
$job_idintNew job ID.
$job_typestringJob type.
$created_byintInitiating user ID.
add_action
add_action( 'davo_migration_job_created', 'my_action_callback', 10, 3 );

/**
 * @param int $job_id
 * @param string $job_type
 * @param int $created_by
 */
function my_action_callback( $job_id, $job_type, $created_by ) {
	// Your code here.
}

src/domains/migrations/repository.php:183

action

davo_migration_job_deleted

Fires after a job (and its failures/ID-map rows and on-disk package directory) has been permanently deleted.

Parameters of davo_migration_job_deleted
ParameterTypeDescription
$job_idintDeleted job ID.
$deleted_jobarray<string, mixed>The job row as it existed immediately before deletion.
add_action
add_action( 'davo_migration_job_deleted', 'my_action_callback', 10, 2 );

/**
 * @param int $job_id
 * @param array<string, mixed> $deleted_job
 */
function my_action_callback( $job_id, $deleted_job ) {
	// Your code here.
}

src/domains/migrations/repository.php:2358

filter

davo_migration_job_options

Filter a new migration job's options before it is recorded.

Parameters of davo_migration_job_options
ParameterTypeDescription
$optionsarray<string, mixed>Job options as requested.
$job_typestringJob type being created.
$created_byintInitiating user ID.
add_filter
add_filter( 'davo_migration_job_options', 'my_filter_callback', 10, 3 );

/**
 * @param array<string, mixed> $options
 * @param string $job_type
 * @param int $created_by
 */
function my_filter_callback( $options, $job_type, $created_by ) {
	// Change $options as needed, then return it.
	return $options;
}

src/domains/migrations/repository.php:152

action

davo_migration_job_paused

Fires when a job is paused, so Migrations_Initializer can clear any pending WP-Cron tick for it. Migrations_Repository never calls wp_clear_scheduled_hook()/wp_schedule_single_event() directly anywhere in this class — see Migrations_Initializer's own top-of-file docblock on keeping every WP-Cron specific isolated there, so swapping the background driver later never touches this file.

Parameters of davo_migration_job_paused
ParameterTypeDescription
$job_idintPaused job ID.
add_action
add_action( 'davo_migration_job_paused', 'my_action_callback', 10, 1 );

/**
 * @param int $job_id
 */
function my_action_callback( $job_id ) {
	// Your code here.
}

src/domains/migrations/repository.php:2208

action

davo_migration_job_started

Fires when a job transitions into RUNNING and is ready for its first step — the single hook point background execution (WP-Cron or otherwise) should listen to, rather than needing a separate one for export vs. import (confirm_import() fires this too).

Parameters of davo_migration_job_started
ParameterTypeDescription
$job_idintJob ID.
add_action
add_action( 'davo_migration_job_started', 'my_action_callback', 10, 1 );

/**
 * @param int $job_id
 */
function my_action_callback( $job_id ) {
	// Your code here.
}

src/domains/migrations/repository.php:716, and 2 more places

filter

davo_migration_referenced_attachment_ids

Filters attachment IDs an export must carry although no content uses them.

Settings that point at a file (a logo) report it here.

Parameters of davo_migration_referenced_attachment_ids
ParameterTypeDescription
$extraarray<int, int>Attachment IDs to add.
$job_idintExport job ID.
add_filter
add_filter( 'davo_migration_referenced_attachment_ids', 'my_filter_callback', 10, 2 );

/**
 * @param array<int, int> $extra
 * @param int $job_id
 */
function my_filter_callback( $extra, $job_id ) {
	// Change $extra as needed, then return it.
	return $extra;
}

src/domains/migrations/referenced-media.php:109

filter

davo_migration_referenced_post_types

Filters the post types to scan for media referenced by the selected content.

Parameters of davo_migration_referenced_post_types
ParameterTypeDescription
$typesstring[]Selected post or page types.
$providersstring[]Selected migration sections.
add_filter
add_filter( 'davo_migration_referenced_post_types', 'my_filter_callback', 10, 2 );

/**
 * @param string[] $types
 * @param string[] $providers
 */
function my_filter_callback( $types, $providers ) {
	// Change $types as needed, then return it.
	return $types;
}

src/domains/migrations/referenced-media.php:58

filter

davo_migrations_allowed_import_directories

Filter the base directories the manual-path import route will accept a package directory from.

Parameters of davo_migrations_allowed_import_directories
ParameterTypeDescription
$allowed_dirsarray<int, string>Absolute base directory paths.
add_filter
add_filter( 'davo_migrations_allowed_import_directories', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, string> $allowed_dirs
 */
function my_filter_callback( $allowed_dirs ) {
	// Change $allowed_dirs as needed, then return it.
	return $allowed_dirs;
}

src/domains/migrations/helpers.php:691

filter

davo_migrations_comments_meta_keys

Filter the comment meta keys carried with core comments.

Parameters of davo_migrations_comments_meta_keys
ParameterTypeDescription
$keysstring[]Meta keys.
add_filter
add_filter( 'davo_migrations_comments_meta_keys', 'my_filter_callback', 10, 1 );

/**
 * @param string[] $keys
 */
function my_filter_callback( $keys ) {
	// Change $keys as needed, then return it.
	return $keys;
}

src/domains/migrations/comments-migration-provider.php:374, and 1 more place

filter

davo_migrations_fallback_author_id

Filters the user assigned as author of migrated content whose source author no longer exists on the source site.

With no fallback (0), such records are reported as failures instead of being silently reassigned to someone.

Parameters of davo_migrations_fallback_author_id
ParameterTypeDescription
$user_idintUser ID. Default 0.
add_filter
add_filter( 'davo_migrations_fallback_author_id', 'my_filter_callback', 10, 1 );

/**
 * @param int $user_id
 */
function my_filter_callback( $user_id ) {
	// Change $user_id as needed, then return it.
	return $user_id;
}

src/domains/migrations/helpers.php:871

filter

davo_migrations_is_importing

Filters whether a migration import is currently running.

Parameters of davo_migrations_is_importing
ParameterTypeDescription
$importingboolTrue while a provider's import() is on the stack.
add_filter
add_filter( 'davo_migrations_is_importing', 'my_filter_callback', 10, 1 );

/**
 * @param bool $importing
 */
function my_filter_callback( $importing ) {
	// Change $importing as needed, then return it.
	return $importing;
}

src/domains/migrations/helpers.php:853

filter

davo_migrations_max_extracted_bytes

Filters the largest total size, in bytes, an uploaded migration package may expand to.

Parameters of davo_migrations_max_extracted_bytes
ParameterTypeDescription
$bytesintDefault Migrations_Helpers::DEFAULT_MAX_EXTRACTED_BYTES.
add_filter
add_filter( 'davo_migrations_max_extracted_bytes', 'my_filter_callback', 10, 1 );

/**
 * @param int $bytes
 */
function my_filter_callback( $bytes ) {
	// Change $bytes as needed, then return it.
	return $bytes;
}

src/domains/migrations/package-extractor.php:562

filter

davo_migrations_media_export_batch_bytes

Filters the maximum number of bytes one export step bundles.

Parameters of davo_migrations_media_export_batch_bytes
ParameterTypeDescription
$max_bytesintDefault limit.
add_filter
add_filter( 'davo_migrations_media_export_batch_bytes', 'my_filter_callback', 10, 1 );

/**
 * @param int $max_bytes
 */
function my_filter_callback( $max_bytes ) {
	// Change $max_bytes as needed, then return it.
	return $max_bytes;
}

src/domains/migrations/media-transfer.php:121

filter

davo_migrations_media_export_batch_files

Filters the maximum number of files one export step bundles.

Parameters of davo_migrations_media_export_batch_files
ParameterTypeDescription
$max_filesintDefault limit.
add_filter
add_filter( 'davo_migrations_media_export_batch_files', 'my_filter_callback', 10, 1 );

/**
 * @param int $max_files
 */
function my_filter_callback( $max_files ) {
	// Change $max_files as needed, then return it.
	return $max_files;
}

src/domains/migrations/media-transfer.php:114

action

davo_migrations_media_export_skipped

Fires when an attachment is left out of an export because it cannot be bundled.

Parameters of davo_migrations_media_export_skipped
ParameterTypeDescription
$attachment_idintAttachment post ID.
$reasonstringOne of missing_post, unexpected_path, no_uploads_dir, missing_file, copy_failed.
$job_idintExport job the file belongs to, or 0 outside a job.
$provider_keystringProvider whose export skipped the file, or '' outside a job.
add_action
add_action( 'davo_migrations_media_export_skipped', 'my_action_callback', 10, 4 );

/**
 * @param int $attachment_id
 * @param string $reason
 * @param int $job_id
 * @param string $provider_key
 */
function my_action_callback( $attachment_id, $reason, $job_id, $provider_key ) {
	// Your code here.
}

src/domains/migrations/media-transfer.php:949

action

davo_migrations_media_imported

Fires after a migration creates an attachment from a package.

Parameters of davo_migrations_media_imported
ParameterTypeDescription
$attachment_idintDestination attachment post ID.
$provider_keystringProvider that imported it.
$source_idstringSource-side attachment post ID.
add_action
add_action( 'davo_migrations_media_imported', 'my_action_callback', 10, 3 );

/**
 * @param int $attachment_id
 * @param string $provider_key
 * @param string $source_id
 */
function my_action_callback( $attachment_id, $provider_key, $source_id ) {
	// Your code here.
}

src/domains/migrations/media-transfer.php:631

filter

davo_migrations_media_library_sanitize_svg

Filters the SVG sanitizer used for media library files.

A callback cleans the file at $path in place and returns true, or returns a WP_Error to refuse it. Returning null (the default) means no sanitizer is available and the SVG is refused.

Parameters of davo_migrations_media_library_sanitize_svg
ParameterTypeDescription
$resulttrue|WP_Error|nullSanitizer outcome.
$pathstringAbsolute path of the file.
$filenamestringFile name.
add_filter
add_filter( 'davo_migrations_media_library_sanitize_svg', 'my_filter_callback', 10, 3 );

/**
 * @param true|WP_Error|null $result
 * @param string $path
 * @param string $filename
 */
function my_filter_callback( $result, $path, $filename ) {
	// Change $result as needed, then return it.
	return $result;
}

src/domains/migrations/media-library-migration-provider.php:284

filter

davo_migrations_media_library_scope

Filters how much of the media library is exported.

Parameters of davo_migrations_media_library_scope
ParameterTypeDescription
$scopestringall or referenced. Defaults to the export job's choice.
add_filter
add_filter( 'davo_migrations_media_library_scope', 'my_filter_callback', 10, 1 );

/**
 * @param string $scope
 */
function my_filter_callback( $scope ) {
	// Change $scope as needed, then return it.
	return $scope;
}

src/domains/migrations/media-library-migration-provider.php:213

filter

davo_migrations_meta_import_value

Filters a custom-field value after it has been converted and sanitized for this site.

For a value whose shape is more than one ID or one scalar: a json value that carries an attachment ID next to other fields (a menu item's icon) cannot be remapped by the generic types, so the domain that owns the key finishes the job here. Return null to skip the value; it is then reported as "could not be converted". Runs for post meta, term meta and reference-valued option keys alike, and only for keys this site declares or the administrator approved, so check $key.

Parameters of davo_migrations_meta_import_value
ParameterTypeDescription
$valuemixedConverted value, or null when the generic conversion already refused it.
$typestringType the value was converted as.
$keystringMeta key.
$contextMigration_ContextShared job context (ID map, job ID).
add_filter
add_filter( 'davo_migrations_meta_import_value', 'my_filter_callback', 10, 4 );

/**
 * @param mixed $value
 * @param string $type
 * @param string $key
 * @param Migration_Context $context
 */
function my_filter_callback( $value, $type, $key, $context ) {
	// Change $value as needed, then return it.
	return $value;
}

src/domains/migrations/meta-registry.php:505

filter

davo_migrations_meta_map

Filters the custom-field keys that migrate, with the type of each.

Example: $map['_gallery_ids'] = 'attachments';. Types are listed in Migration_Meta_Registry::TYPES.

Parameters of davo_migrations_meta_map
ParameterTypeDescription
$maparray<string, string>Key => type.
add_filter
add_filter( 'davo_migrations_meta_map', 'my_filter_callback', 10, 1 );

/**
 * @param array<string, string> $map
 */
function my_filter_callback( $map ) {
	// Change $map as needed, then return it.
	return $map;
}

src/domains/migrations/meta-registry.php:92

filter

davo_migrations_not_migrated

Filters the list of things a migration does not carry over.

A domain that gains a provider can remove its entry; a domain that knowingly leaves data out can add one.

Parameters of davo_migrations_not_migrated
ParameterTypeDescription
$itemsarray<int, array<string, string>>Entries with key, title, reason, action and severity.
add_filter
add_filter( 'davo_migrations_not_migrated', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, array<string, string>> $items
 */
function my_filter_callback( $items ) {
	// Change $items as needed, then return it.
	return $items;
}

src/domains/migrations/environment.php:153

filter

davo_migrations_options_optional_providers

Filters the providers the settings import prefers to run after.

For a domain whose settings hold the IDs of records that no content provider key covers (a collection, for instance). Ordering only: a key is honoured when that provider is in the job and never widens it.

Parameters of davo_migrations_options_optional_providers
ParameterTypeDescription
$keysstring[]Provider keys: the content providers, users, media and attachments.
add_filter
add_filter( 'davo_migrations_options_optional_providers', 'my_filter_callback', 10, 1 );

/**
 * @param string[] $keys
 */
function my_filter_callback( $keys ) {
	// Change $keys as needed, then return it.
	return $keys;
}

src/domains/migrations/options-migration-provider.php:100

filter

davo_migrations_package_retention_days

Filters how many days a finished job's package is kept on the server.

Parameters of davo_migrations_package_retention_days
ParameterTypeDescription
$daysarray{import: int, export: int}Days per job type; 0 keeps packages forever.
add_filter
add_filter( 'davo_migrations_package_retention_days', 'my_filter_callback', 10, 1 );

/**
 * @param array{import: int, export: int} $days
 */
function my_filter_callback( $days ) {
	// Change $days as needed, then return it.
	return $days;
}

src/domains/migrations/repository.php:2450

filter

davo_migrations_pages_post_types

The source has no description for this hook. It is called from Migration_Meta_Registry::content_post_types().

Passed to callbacks: array( 'page' )

add_filter
add_filter( 'davo_migrations_pages_post_types', 'my_filter_callback', 10, 1 );

function my_filter_callback( $arg1 ) {
	// Change $arg1 as needed, then return it.
	return $arg1;
}

src/domains/migrations/meta-registry.php:204

filter

davo_migrations_posts_optional_providers

Filters the providers a Posts provider instance prefers to run after.

Ordering only: a key is honoured when that provider is in the job and never widens it.

Parameters of davo_migrations_posts_optional_providers
ParameterTypeDescription
$keysstring[]Provider keys. Default media_library.
$provider_keystringKey of this Posts provider instance.
add_filter
add_filter( 'davo_migrations_posts_optional_providers', 'my_filter_callback', 10, 2 );

/**
 * @param string[] $keys
 * @param string $provider_key
 */
function my_filter_callback( $keys, $provider_key ) {
	// Change $keys as needed, then return it.
	return $keys;
}

src/domains/migrations/posts-migration-provider.php:143

filter

davo_migrations_posts_post_types

The source has no description for this hook. It is called from Migration_Meta_Registry::content_post_types().

Passed to callbacks: array( 'post' )

add_filter
add_filter( 'davo_migrations_posts_post_types', 'my_filter_callback', 10, 1 );

function my_filter_callback( $arg1 ) {
	// Change $arg1 as needed, then return it.
	return $arg1;
}

src/domains/migrations/meta-registry.php:194

filter

davo_migrations_posts_rewrite_urls

Filters whether URLs in migrated content are pointed at this site.

Parameters of davo_migrations_posts_rewrite_urls
ParameterTypeDescription
$rewriteboolDefault true.
add_filter
add_filter( 'davo_migrations_posts_rewrite_urls', 'my_filter_callback', 10, 1 );

/**
 * @param bool $rewrite
 */
function my_filter_callback( $rewrite ) {
	// Change $rewrite as needed, then return it.
	return $rewrite;
}

src/domains/migrations/content-fixer.php:72

filter

davo_migrations_posts_taxonomies

Filter the taxonomies whose terms travel with core content.

Parameters of davo_migrations_posts_taxonomies
ParameterTypeDescription
$taxonomiesstring[]Taxonomy slugs.
add_filter
add_filter( 'davo_migrations_posts_taxonomies', 'my_filter_callback', 10, 1 );

/**
 * @param string[] $taxonomies
 */
function my_filter_callback( $taxonomies ) {
	// Change $taxonomies as needed, then return it.
	return $taxonomies;
}

src/domains/migrations/posts-migration-provider.php:1044

action

davo_migrations_register_matchers

Fires once per Reference_Resolver instance, after the built-in core-namespace matchers above are already registered, so a domain that owns a namespace of its own (see Has_Reference_Namespaces) and has a meaningful identity-match question can register its matcher too — Custom Fields' definitions namespace (matched by owner_type + name, since the table's own natural key is a random UUID with no cross-install meaning) is the first real example of a domain needing this.

Parameters of davo_migrations_register_matchers
ParameterTypeDescription
$resolverReference_ResolverThis resolver instance.
add_action
add_action( 'davo_migrations_register_matchers', 'my_action_callback', 10, 1 );

/**
 * @param Reference_Resolver $resolver
 */
function my_action_callback( $resolver ) {
	// Your code here.
}

src/domains/migrations/reference-resolver.php:71

filter

davo_migrations_side_effect_domains

Filters the domain namespace segments treated as reactive.

Parameters of davo_migrations_side_effect_domains
ParameterTypeDescription
$domainsarray<int, string>Segments such as Notifications.
add_filter
add_filter( 'davo_migrations_side_effect_domains', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, string> $domains
 */
function my_filter_callback( $domains ) {
	// Change $domains as needed, then return it.
	return $domains;
}

src/domains/migrations/side-effect-guard.php:178

filter

davo_migrations_side_effect_hooks

Filters the core hooks that are scanned for reactive callbacks.

Parameters of davo_migrations_side_effect_hooks
ParameterTypeDescription
$hooksarray<int, string>Exact hook names.
add_filter
add_filter( 'davo_migrations_side_effect_hooks', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, string> $hooks
 */
function my_filter_callback( $hooks ) {
	// Change $hooks as needed, then return it.
	return $hooks;
}

src/domains/migrations/side-effect-guard.php:185

action

davo_migrations_step_exception

Fires when a migration provider throws an exception while running a step.

Parameters of davo_migrations_step_exception
ParameterTypeDescription
$job_idintMigration job ID.
$error\ThrowableWhat the provider threw.
add_action
add_action( 'davo_migrations_step_exception', 'my_action_callback', 10, 2 );

/**
 * @param int $job_id
 * @param \Throwable $error
 */
function my_action_callback( $job_id, $error ) {
	// Your code here.
}

src/domains/migrations/repository.php:891

filter

davo_migrations_step_lease_seconds

Filters how many seconds a step's lease is honoured before another request may take the job over.

Parameters of davo_migrations_step_lease_seconds
ParameterTypeDescription
$secondsintDefault Migrations_Helpers::STEP_LEASE_SECONDS.
add_filter
add_filter( 'davo_migrations_step_lease_seconds', 'my_filter_callback', 10, 1 );

/**
 * @param int $seconds
 */
function my_filter_callback( $seconds ) {
	// Change $seconds as needed, then return it.
	return $seconds;
}

src/domains/migrations/repository.php:780, and 1 more place

filter

davo_migrations_suppress_side_effects

Filters whether side effects of reactive domains are suppressed while a migration replays historical data.

Parameters of davo_migrations_suppress_side_effects
ParameterTypeDescription
$suppressboolDefault true.
add_filter
add_filter( 'davo_migrations_suppress_side_effects', 'my_filter_callback', 10, 1 );

/**
 * @param bool $suppress
 */
function my_filter_callback( $suppress ) {
	// Change $suppress as needed, then return it.
	return $suppress;
}

src/domains/migrations/side-effect-guard.php:116

filter

davo_migrations_term_meta_map

Filters the term meta keys that migrate, with the type of each, scoped by taxonomy so one key name can mean different things on different taxonomies.

Example: $map['nav_menu']['my_flag'] = 'bool';. Types are the same set as Migration_Meta_Registry::TYPES.

Parameters of davo_migrations_term_meta_map
ParameterTypeDescription
$maparray<string, array<string, string>>Taxonomy => ( key => type ).
add_filter
add_filter( 'davo_migrations_term_meta_map', 'my_filter_callback', 10, 1 );

/**
 * @param array<string, array<string, string>> $map
 */
function my_filter_callback( $map ) {
	// Change $map as needed, then return it.
	return $map;
}

src/domains/migrations/term-meta-registry.php:57

filter

davo_migrations_unreported_records_are_failures

Filters whether a record a provider never reported on is treated as a failure.

Left on, a silently dropped record is visible in the failure report instead of disappearing. Turning it off restores the old behaviour.

Parameters of davo_migrations_unreported_records_are_failures
ParameterTypeDescription
$enforceboolWhether to record unreported records as failures.
add_filter
add_filter( 'davo_migrations_unreported_records_are_failures', 'my_filter_callback', 10, 1 );

/**
 * @param bool $enforce
 */
function my_filter_callback( $enforce ) {
	// Change $enforce as needed, then return it.
	return $enforce;
}

src/domains/migrations/import-runner.php:128

filter

davo_migrations_users_allow_privileged_roles

Filters whether a privileged role may be granted to a migrated user. Intended for a developer who deliberately wants staff accounts to carry over; a package cannot influence it.

Parameters of davo_migrations_users_allow_privileged_roles
ParameterTypeDescription
$allowboolWhether to allow privileged roles. Default false.
$rolestringRole slug being considered.
add_filter
add_filter( 'davo_migrations_users_allow_privileged_roles', 'my_filter_callback', 10, 2 );

/**
 * @param bool $allow
 * @param string $role
 */
function my_filter_callback( $allow, $role ) {
	// Change $allow as needed, then return it.
	return $allow;
}

src/domains/migrations/users-migration-provider.php:448

filter

davo_migrations_users_exportable

Filters whether a user is part of an export. All users are exported by default.

Parameters of davo_migrations_users_exportable
ParameterTypeDescription
$exportableboolWhether to export the user.
$userWP_User|falseThe user.
add_filter
add_filter( 'davo_migrations_users_exportable', 'my_filter_callback', 10, 2 );

/**
 * @param bool $exportable
 * @param WP_User|false $user
 */
function my_filter_callback( $exportable, $user ) {
	// Change $exportable as needed, then return it.
	return $exportable;
}

src/domains/migrations/users-migration-provider.php:177

filter

davo_migrations_users_role_map

The source has no description for this hook. It is called from Users_Migration_Provider::resolve_role().

Passed to callbacks: array( 'davo_editor' => 'davo_editor', 'davo_agent' => 'davo_agent', )

add_filter
add_filter( 'davo_migrations_users_role_map', 'my_filter_callback', 10, 1 );

function my_filter_callback( $arg1 ) {
	// Change $arg1 as needed, then return it.
	return $arg1;
}

src/domains/migrations/users-migration-provider.php:414

filter

davo_migrations_widgets_types

Filter the widget base IDs that migrate.

Parameters of davo_migrations_widgets_types
ParameterTypeDescription
$typesstring[]Widget base IDs (the part of a widget ID before its instance number).
add_filter
add_filter( 'davo_migrations_widgets_types', 'my_filter_callback', 10, 1 );

/**
 * @param string[] $types
 */
function my_filter_callback( $types ) {
	// Change $types as needed, then return it.
	return $types;
}

src/domains/migrations/widgets-migration-provider.php:432

action

davo_register_migration_providers

Fires once at init, after every domain's own earlier init hooks have had a chance to run, so each migratable domain can register its Migration_Provider implementation.

Example, from a domain's own initializer: \add_action( 'davo_register_migration_providers', function ( Migration_Registry $registry ): void { $registry->register( new Bookmarks_Migration_Provider( $this->db ) ); } );

Parameters of davo_register_migration_providers
ParameterTypeDescription
$registryMigration_RegistryShared registry instance.
add_action
add_action( 'davo_register_migration_providers', 'my_action_callback', 10, 1 );

/**
 * @param Migration_Registry $registry
 */
function my_action_callback( $registry ) {
	// Your code here.
}

src/domains/migrations/initializer.php:458

Note. Generated from the plugin source. Descriptions and parameters are the ones written in the code. The starter code uses the parameter names from those comments, or generic names where there are none, so check them against your use.

See it on your own site.

Davo is a WordPress theme and plugin by Exorex.

  • Runs on your own WordPress
  • Guided setup wizard
  • AI is off until you switch it on
  • Read the licence on the marketplace first