Created
February 13, 2020 06:00
-
-
Save webtoffee-git/347434951e5877451cc4cd8942f988f8 to your computer and use it in GitHub Desktop.
Export product images by WooCommerce additional variation images - WebToffee Product Import Export for WooCommerce
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
| function webtoffee_export_additional_product_variation_images($row = array(), $pid = '', $header_row = array()) { | |
| $key = array_search('"meta:woo_variation_gallery_images"', $header_row); | |
| if (isset($row[$key]) && !empty($row[$key])) { | |
| $attachment_ids = json_decode($row[$key]); | |
| foreach ($attachment_ids as $id) { | |
| $attached_file_url[] = wp_get_attachment_url($id); | |
| } | |
| $row[$key] = implode(',', $attached_file_url); | |
| } | |
| return $row; | |
| } | |
| add_filter('hf_alter_product_export_csv_data', 'webtoffee_export_additional_product_variation_images', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment