Issue with terms page and polylang
-
Hi @themealien,
I’ve come across a little issue when configuring product attributes in a multilingual install using polylang pro/polylang for woocommerce.
Basically, the language fields also display the thumbnail rather than the polylang edit options (see screenshot: https://imgur.com/BUyqOJU).
I think a quick test that we are in the thumnb column at the top of
add_attribute_column_content
inclass-admin.php
should resolve it:if ('thumb' !== $column) { return $columns; }
So in full,
/** * Render thumbnail HTML depend on attribute type * * @param $columns * @param $column * @param $term_id */ public function add_attribute_column_content($columns, $column, $term_id) { if ('thumb' !== $column) { return $columns; } $attr = TA_WCVS()->get_tax_attribute($_REQUEST['taxonomy']); $value = get_term_meta($term_id, $attr->attribute_type, true); // error_log($attr->attribute_type); switch ($attr->attribute_type) { case 'color': return sprintf('<div class="swatch-preview swatch-color" style="background-color:%s;"></div>', esc_attr($value)); break; case 'image': $image = $value ? wp_get_attachment_image_src($value) : ''; $image = $image ? $image[0] : WC()->plugin_url() . '/assets/images/placeholder.png'; return sprintf('<img class="swatch-preview swatch-image" src="%s" width="44px" height="44px">', esc_url($image)); break; case 'label': return sprintf('<div class="swatch-preview swatch-label">%s</div>', esc_html($value)); break; } }
Any chance of getting that into your next update? Or if there’s somewhere I can raise you a PR I’m happy to ??
Thanks,
Phil
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Issue with terms page and polylang’ is closed to new replies.