$arr_tovar = $result->products;
$params = [
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( 'admin:123123123' )
),
'body' => [],
];
foreach ($arr_tovar as $item) {
$params['body'][] = array(
'name' => $item->name,
'status' => 'pending',
'categories' => array(
array(
'id_iiko_категории' => $item->productCategoryId
)
),
'regular_price' => $item->price
);
}
$api_response = wp_remote_post( $url_site.'/wp-json/wc/v3/products', $params);
$body = json_decode( $api_response['body'] );
if( wp_remote_retrieve_response_message( $api_response ) === 'Created' ) {
echo 'The product ' . $body->name . ' has been created';
}
print_r( $body );
<?php
$checked = 5;
$count = 5;
for($i = 1; $i <= $count; $i++) {
$isChecked = $i == $checked ? 'checked' : '';
echo "
<input class='rating-input' id='mod{$i}' name='radio-rating' type='radio' value='{$i}' {$isChecked}>
<label class='rating-star' for='mod{$i}' ></label>
";
}
background-size: auto 100%;
background-position: top left;
return false
лишняя конструкция, т.к. в события after уже ничего не отменяется.public static function
, чтобы однозначно его идентифицировать. <div class='custom-textarea'>
<textarea class='custom-textarea__textarea'></textarea>
<div class='custom-textarea__buttons'>
<button class='custom-textarea__btn js-custom-textarea-attach-click'>
<!-- иконка скрепки -->
</button>
<button class='custom-textarea__btn js-custom-textarea-send-click'>
<!-- иконка самолета -->
</button>
</div>
</div>