Last active
September 26, 2018 14:32
-
-
Save EricBusch/04636ff9db54790ca5ae1ee411b1b766 to your computer and use it in GitHub Desktop.
Import a product image during a Product Set update. [datafeedr]dfrps][dfrpswc]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Import a product image during a Product Set update. | |
* | |
* This WILL cause product set updates to be slower. | |
* | |
* @param array $post Array containing WordPress Post information. | |
* @param array $product Array containing Datafeedr Product information. | |
* @param array $set Array containing Product Set information. | |
* @param string $action Either "update" or "insert" depending on what the Product Set is doing. | |
*/ | |
function mycode_import_product_image_during_product_set_update( $post, $product, $set, $action ) { | |
dfrps_import_post_thumbnail( $post['ID'] ); | |
} | |
add_action( 'dfrpswc_do_product', 'mycode_import_product_image_during_product_set_update', 20, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment