nocache_headers();
wp_clear_auth_cookie();
wp_set_auth_cookie( $user_id );
<Product>
<SKU>10027105</SKU>
<Brand_Name>Adidas</Brand_Name>
<Product_Name>Adidas Mens Climacool Boat Lace Shoes - Sale</Product_Name>
<Long_Description>...</Long_Description>
<Short_Description>...</Short_Description>
<Category>Footwear</Category>
<SubCategory>Casual</SubCategory>
<Product_Group>Men's</Product_Group>
<Thumb_URL>...</Thumb_URL>
<Image_URL>...</Image_URL>
<Buy_Link>...</Buy_Link>
<Retail_Price>74.99</Retail_Price>
<Sale_Price>59.99</Sale_Price>
<Extended_Xml_Attributes>
<variants>
<variant>
<sku>19301</sku>
<upc>0886833708180</upc>
<size>8</size>
<color>Dark Indigo</color>
<retail_price>74.99</retail_price>
<sale_price>59.99</sale_price>
<action_url>...</action_url>
</variant>
<variant/>
...
</variants>
</Extended_Xml_Attributes>
</Product>
function wpp_change_svg_img_color( $url, $color ) {
$content = file_get_contents( $url );
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
$doc->loadXML( $content ) or die( 'Failed to load SVG ' . $url );
$paths = $doc->getElementsByTagName( "path" );
foreach ( $paths as $path ) {
$path->setAttribute( 'fill', $color );
$path->setAttribute( 'style', 'fill:' . $color );
$content = $doc->saveXML( $doc );
}
return $content;
}
$url = the_post_thumbnail_url( 'full' ); // url миниатюры
$color = '#000000'; #нужный вам цвет
printf( '<img src="%s" alt="">', wpp_change_svg_img_color( $url, $color) );
if(!empty($vid_oblojki) && mb_substr($vid_oblojki,'глянцевая')) :
// код
endif;
if ( ! empty( $vid_oblojki ) && mb_substr( implode( '', $vid_oblojki ), 'Глянцевая' ) ) :
endif;
<select name="cover_type" id="cover_type">
<options value="">Выберите вид обложки</options>
<options value="1">Мягкая</options>
<options value="2">Глянцевая</options>
</select>
if(!empty($vid_oblojki) && 2 === (int)$vid_oblojki) :
// код
endif;