Last active
February 8, 2020 10:36
-
-
Save thijsbouwes/cd611e04fd8fca1ba5d8817719cc4562 to your computer and use it in GitHub Desktop.
Daiscon pixel bulk edit
This file contains 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 | |
add_action('woocommerce_product_bulk_edit_start', 'daisycon_pixel_cc_field_bulk_edit_input'); | |
function daisycon_pixel_cc_field_bulk_edit_input() { | |
?> | |
<div class="inline-edit-group"> | |
<label class="alignleft"> | |
<span class="title"> | |
<?php _e('Daisycon Pixel Commissie Code', 'woocommerce'); ?> | |
</span> | |
<span class="input-text-wrap"> | |
<input type="text" name="_daisycon_cc" class="text" value=""> | |
</span> | |
</label> | |
</div> | |
<?php | |
} | |
add_action('woocommerce_product_bulk_edit_save', 'daisycon_pixel_cc_field_bulk_edit_save'); | |
function daisycon_pixel_cc_field_bulk_edit_save($product) { | |
$field = $_REQUEST['_daisycon_cc']; | |
if ($field) { | |
update_post_meta($product->get_id(), '_daisycon_cc', wc_clean($field)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment