VAT
Your cart

Your cart is empty.

Content transfer hooks

This page lists the 7 hooks of this group. Each entry shows its type, the version it arrived in, where it runs, its arguments and a starting point.

adba_transfer_export_item

FilterSince 2.26.0 Runs in src/Modules/Transfer/Exporter.php.

Filters an exported item before it goes into the file. Add fields of your own here and read them back in adba_transfer_import_item.

ArgumentTypeDescription
$itemarray<string, mixed>Item.
$post\WP_PostSource post.
add_filter( 'adba_transfer_export_item', function ( $item, $post ) {
	return $item;
}, 10, 2 );

adba_transfer_exported

ActionSince 2.26.0 Runs in src/Modules/Transfer/Runner.php.

Fires after an export file was written.

ArgumentTypeDescription
$filestringAbsolute path of the export file.
$jobarray<string, mixed>The export job.
add_action( 'adba_transfer_exported', function ( $file, $job ) {
	// ...
}, 10, 2 );

adba_transfer_import_item

FilterSince 2.26.0 Runs in src/Modules/Transfer/Importer.php.

Filters an item before it is imported. Return null to skip it.

ArgumentTypeDescription
$itemarray<string, mixed>|nullItem from the file.
$modestringupdate or new.
$targetintId that is updated, 0 for a new item.
add_filter( 'adba_transfer_import_item', function ( $item, $mode, $target ) {
	return $item;
}, 10, 3 );

adba_transfer_imported

ActionSince 2.26.0 Runs in src/Modules/Transfer/Importer.php.

Fires after an import finished.

ArgumentTypeDescription
$reportarray<string, mixed>created, updated, skipped and failed (title, reason).
$jobarray<string, mixed>The import job.
add_action( 'adba_transfer_imported', function ( $report, $job ) {
	// ...
}, 10, 2 );

adba_transfer_meta_exclude

FilterSince 2.26.0 Runs in src/Modules/Transfer/MetaFilter.php.

Filters the meta keys left out of a content export and ignored on import. Patterns are fnmatch() globs, like '_my_plugin_cache_*'. Remove a pattern to let a key travel after all.

ArgumentTypeDescription
$patternsstring[]Key patterns.
add_filter( 'adba_transfer_meta_exclude', function ( $patterns ) {
	return $patterns;
} );

adba_transfer_register_sources

ActionSince 2.36.0 Runs in src/Modules/Transfer/Sources.php.

Register sources for Tools > Content: data that is no post, product or term. Call $sources->add() with an object that implements AddoBack\Modules\Transfer\TransferSource.

ArgumentTypeDescription
$sourcesSourcesThe register.
add_action( 'adba_transfer_register_sources', function ( $sources ) {
	// ...
} );

adba_transfer_types

FilterSince 2.26.0 Runs in src/Modules/Transfer/Types.php.

Filters the content types that can be exported and imported. Add a post type with kind 'post', a post_type, a cap and the taxonomies that travel with it, or a taxonomy with kind 'term' under the id 'term:{taxonomy}'. Kind 'product' is reserved for WooCommerce products.

ArgumentTypeDescription
$typesarray<string, array<string, mixed>>Types by id.
add_filter( 'adba_transfer_types', function ( $types ) {
	return $types;
} );

Ready to connect your AI to real tools?

Start free trial