Gallery insert into fix

This commit is contained in:
Mike Jolley 2011-10-04 23:38:52 +01:00
parent 3e5f2f15b9
commit 6e19c9d546
3 changed files with 11 additions and 4 deletions

View File

@ -343,11 +343,11 @@ add_filter('attachment_fields_to_save', 'woocommerce_exclude_image_from_product_
function woocommerce_exclude_image_from_product_page_field( $fields, $object ) {
if (!$object->post_parent) return;
if (!$object->post_parent) return $fields;
$parent = get_post( $object->post_parent );
if ($parent->post_type!=='product') return;
if ($parent->post_type!=='product') return $fields;
$exclude_image = (int) get_post_meta($object->ID, '_woocommerce_exclude_image', true);

View File

@ -322,8 +322,13 @@ function variable_product_write_panel_js() {
window.send_to_cproduct = function(html) {
imgurl = jQuery('img', html).attr('src');
imgclass = jQuery('img', html).attr('class');
var img = jQuery(html).find('img');
imgurl = jQuery(img).attr('src');
imgclass = jQuery(img).attr('class');
alert(imgclass);
imgid = parseInt(imgclass.replace(/\D/g, ''), 10);
jQuery('.upload_image_id', current_field_wrapper).val(imgid);

View File

@ -69,6 +69,8 @@ For further documentation on using WooCommerce, please sign up for free at http:
* Fixed order tracking completed time
* Sale price affects variable product 'from:' price
* Variation options (frontend) no longer lose your selections when changing an option
* Gallery image field fix
* Image 'insert into' fix
= 1.0.2 - 02/10/2011 =
* Fix in woocommerce_templates for when a shop is the front-page