Hi I have custom fields for woocommerce checkout page.
I want to save it with html output database.
However, these are saved by cleaning html each time.
How can I save the html codes written to these fields to the database?
add_filter(`woocommerce_checkout_fields`, `burayi_ekle`);
function burayi_ekle($fields)
{
$fields['billing']['billing_satis'] = [
'type' => 'textarea',
'label' => __('SATIŞ1', 'woocommerce'),
'class' => ['input-text'],
'required' => true,
'clear' => false,
'priority' => 120,
];
$fields['billing']['billing_satis2'] = [
'type' => 'textarea',
'label' => __('SATIŞ2', 'woocommerce'),
'class' => ['input-text'],
'required' => true,
'clear' => false,
'priority' => 121,
];
return $fields;
}
2
Answers
Okey . i fix it .
This is my true code
You can save WC checkout Custom fields data along with HTML into database. The record would be saved in postmeta table for the post type of Order.
Here you can try following code
Don’t escape html when you add into database using update_post_meta.