وردپرس

Malformed attribute_name in g:product_detail | WordPress.org


Product Feed Pro Version 12.7.8  & PHP 7.4

When mapping attributes to g:product_detail, the phrase “Custom attributes” is not stripped from g:attribute_name

<g:product_detail>
<g:section_name>General</g:section_name>
<g:attribute_name>Custom attributes resistance</g:attribute_name>
<g:attribute_value>100K</g:attribute_value>
</g:product_detail>

Looks like the string replace function in class-get-products.php ( line ~1430 ) is expecting the string to start with a capital C

$section_name_start = str_replace("Custom attributes ", "", $section_name_start);

Replacing with the below regex correctly formats g:attribute_name

$section_name_start = preg_replace('/custom attributes\s+/i', '', $section_name_start);
<g:product_detail>
<g:section_name>General</g:section_name>
<g:attribute_name>Resistance</g:attribute_name>
<g:attribute_value>100K</g:attribute_value>
</g:product_detail>

پایان/ مرجع وب و فناوری

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا