Skip to content

Adding Post Meta Support for Alternate Versions

Inderpreet Singh edited this page Sep 1, 2017 · 4 revisions

To add postmeta support for the BU Versions plugin, you must use the following filter to register the feature and the postmeta keys for the feature. During a clone, the data associated with the meta key will be copied. When the alternate version is "published" the data will overwrite the data stored in each meta key of the original.

<?php
function foo_register_alt_version_features( $features ) {
	$features['feature_name'] = array(
		'_foo_meta_key1',
		'_foo_meta_key2',
	);
	return $features;
}

add_filter( 'bu_alt_versions_feature_support', 'foo_register_alt_version_features' );
Clone this wiki locally