Skip to main content

vc_import_post_meta

Filters the array of post meta entries before they are saved during the WPBakery template import process.

Parameters

ParameterTypeDescription
$postmetaarrayAn array of post meta entries. Each entry is an associative array with key and value keys.
$post_idintThe ID of the newly inserted post.
$postarrayThe original raw post data from the import file.

Usage

<?php
add_filter( 'vc_import_post_meta', 'my_custom_import_post_meta', 10, 3 );

function my_custom_import_post_meta( $postmeta, $post_id, $post ) {
// Add custom meta data to imported posts
$postmeta[] = [
'key' => '_imported_from',
'value' => 'wpbakery_template',
];
return $postmeta;
}

Source

File: include/classes/core/shared-templates/importer/class-vc-wp-import.php