Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Correct import behaviour when WPAllImport is used.
<?php
/*
Plugin Name: Countdown Import Helper
Description: Correct import behaviour when WPAllImport is used.
Version 0.1.0
*/
add_action( 'pmxi_saved_post', 'cdih_save_post', 10, 1 );
function cdih_save_post( $post_id ) {
if ( ! function_exists( 'wc_get_product' ) ) {
return;
}
$product = wc_get_product( $post_id );
if ( $product ) {
# works for simple products
update_post_meta( $post_id, '_wpbpc_product_id', $post_id );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.