Error in wc-template-functions.php V 2.67
-
This is not a support request, it is a bug report and don’t have my GitHub creds handy.
Wordpress 4.61
WC V 2.67Status is moot, it is clear and not provided (everything working fine)
site https://www.scribblings-n-stuff.com/shop , but you won’t see the error as I’ve patched it.Updated WC to 2.67 and came across this, don’t know if it’s a long standing error or this version. You have a double quote kicking invalid HTML warnings/errors.
This would occur the data attribute on any variant product with options.
wcommerce/includes/wc-template-functions.php
On line 2076, (below formatted multi-line for clarity.)
$html = '<select id="' . esc_attr( $id ) . '" class="' . esc_attr( $class ) . '" name="' . esc_attr( $name ) . '" data-attribute_name="attribute_' . esc_attr( sanitize_title( $attribute ) ) . <strong>'"' . // <----- error</strong> '" data-show_option_none="' . ( $show_option_none ? 'yes' : 'no' ) . '">';
creates
<select id="pa_24-x-18" class="variations-select" name="attribute_pa_24-x-18" data-attribute_name="attribute_pa_24-x-18"<strong>"</strong> data-show_option_none="yes">
Kicks “no space between attributes” error due to extra quote.
Should be
$html = '<select id="' . esc_attr( $id ) . '" class="' . esc_attr( $class ) . '" name="' . esc_attr( $name ) . '" data-attribute_name="attribute_' . esc_attr( sanitize_title( $attribute ) ) . '" data-show_option_none="' . ( $show_option_none ? 'yes' : 'no' ) . '">'
- The topic ‘Error in wc-template-functions.php V 2.67’ is closed to new replies.